F147_PR

Parallel printout

Outputs the ASCII codes for 12 characters stored in the 6-word area specified by s_Start via the word output specified by d if the trigger EN is TRUE. If a printer is connected to the output specified by d, a character corresponding to the output ASCII code is printed.

Parameters

Input

s_Start (WORD, INT, UINT)

starting 16-bit area for storing 12 bytes (6 words) of ASCII codes (source)

Output

d (WORD)

word output used for output of ASCII codes (destination)

Remarks

  • Only bit positions 0 to 8 of d are used in the actual printout. ASCII code is output in sequence starting with the lower byte of the starting area. Three scans are required for 1 character constant output. Therefore, 37 scans are required until all characters constants are output.

  • Since it is not possible to execute multiple F147_PR instructions in one scan, use print-out flag sys_bIsActive_F147_PR to be sure they are not executed simultaneously. If the character constants convert to ASCII code, use of the F95_ASC instruction is recommended.

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the ending area for storing ASCII codes exceeds the limit

  • if the trigger of another F147_PR instruction turns to TRUE while one F147_PR instruction is being executed

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the ending area for storing ASCII codes exceeds the limit

  • if the trigger of another F147_PR instruction turns to TRUE while one F147_PR instruction is being executed

Connection example

  1.  (1) Transistor output type (output: 9 points or more)
  2.  (2) Printer (centronics interface)

Example

Global variables

In the global variable list you define variables that can be accessed by all POUs in the project.

  1.  (1) Source: ASCII code for 12 characters A, B, C, D, E, F, G, H, I and J
  2.  (2) Control data for printer
  3.  (3) ASCII codes
  4.  (4) start: ON
  5.  (5) Destination
  6.  (6) Y9 to YF: not used
  7.  (7) Y8: for strobe signal of printer
  8.  (8) Y0 to YF: for data signals of printer (Y0 to Y7 correspond to DA A1 to DA A8 of printer)

POU header

All input and output variables used for programming this function have been declared in the POU header.The same POU header is used for all programming languages.

	VAR
		Start: BOOL:=FALSE;
	END_VAR
	VAR_EXTERNAL
		PrintOutFlag: BOOL:=FALSE;
	END_VAR
	VAR 
		PrintOutString: STRING[12]:='ABCDEFGHIJ$L$R';
	END_VAR
	VAR_EXTERNAL
		Printer: WORD:=0;
	END_VAR
	VAR 
		@'': @'';
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 13 ;
        NETWORK_BODY
B(B_CONTACT,,Start,4,2,6,4,R);
B(B_F,F147_PR!,Instance,19,1,25,5,,?DEN?Ds_Start?AENO?Cd);
B(B_CONTACT,,PrintOutFlag,4,5,6,7,);
B(B_VAROUT,,Printer,25,3,27,5,);
B(B_F,Adr_Of_VarOffs_I!,Instance,9,7,18,11,,?D@'Var'?DOffs?CAdr);
B(B_VARIN,,2,7,9,9,11,);
B(B_VARIN,,PrintOutString,7,8,9,10,);
L(1,3,4,3);
L(6,3,19,3);
L(1,6,4,6);
L(6,6,10,6);
L(10,3,10,6);
L(19,4,19,9);
L(18,9,19,9);
L(1,0,1,13);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF DF(start) OR PrintOutFlag then
    F147_PR( Adr_Of_VarOffs( PrintOutString, 2), Printer);
END_IF;

Modified on: 2019-01-25Feedback on this pagePanasonic hotline