|
Serial
Communication Example Programs
|
| These examples are provided to demonstrate certain functions using FACTS BASIC Modules. If you download and use any of these example programs, It is your responsibility to test and modify the program to meet your application requirements. |
|
Read string data from one serial device, parse numeric data from the
string, and write integer data to V2000 in BCD Word format. |
||
|
Read string data from one serial device, parse numeric data from the
string, and write integer data to V2000/V2001 in BCD Double Word format. |
||
|
Read string data from two serial devices, parse numeric data from the
string, and write integer data for device 1 to V2000/2001 in BCD Double
Word format and device 2 to V2002/2003 in BCD Double Word format.. |
||
|
Read string data from a serial device, parse numeric data from the
string, and write integer data to V2000 in BCD format. |
||
|
Read data from a bar code reader, parse data from the string and write
the numeric and ASCII code data to the PLC. |
||
|
Read a string from a serial device containing a 10 digit integer and
write to 3 contigous V-memory locations. |
||
|
Request string data from a serial device, parse numeric data from the
string, and write integer data to V2000 in BCD format. |
||
|
Read string data from one serial device, parse numeric data from the string, and write integer data to V2000/V2001 in BCD Double Word format. Serial Data Format: f4comex3.abm (F4-CP128-1) |
||
|
Read string data from one serial device, parse numeric data from the string, and write integer data to V2000/V2001 in BCD Double Word format. Serial Data Format: f4comex3.abm (F4-CP128-1) |
||
|
(1) Read Setpoint data from PLC V-Mem SP High Integer = V1401 (0-9999)
SP High Fractional = V1400 (0-999) SP Low Integer = V1403 (0-9999) SP
Low Fractional = V1402 (0-999) NOTE: Setpoint Data Must be in BCD format
rdscl_f2.abm (F2-CP128) |
||
|
Read Power Meter information from a 3300 ACM connected via 2-wire RS485 using Modbus Function Code 3. 3300acm.abm (F4-CP128-1) |
||
|
Simple Optomux Master optomast.abm (F4-CP128-1) |
||
|
Simple Modbus RTU Master modmast.abm (F4-CP128-1) |
||
|
Print the decimal value of the ASCII code of each character of $(0) (read as string 0). 100 FOR X=1 TO LEN($(0)) To print the hex value of the ASCII code change line 105 to: 105 PRINT1 HEX$(ASC($(0),X),1), SPC(1), |
||
|
Copy the ASCII code of each character of $(0) (read as string 0) to a numeric array element. 10 DIM CHAR(20) |
||
|
Read a string from a device and write the ASCII codes for that string to a block of V-memory in the PLC. f0_rdstr_writeplc.abm (F0-CP128) |
||
| Updated 1/21/2008 |