|
PLC
Communication Examples
|
| 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. |
|
(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 24 Analog Input Values starting at V1400 and 8 Analog Output Values starting at V1430 every 10 minutes and log them into BASIC Memory. There will be a dedicated portion of memory for each 10 minute period containing an Hour/Minute Label and all Analog Input/Output values for that ten minute period. abmlog.abm (F4-CP128-1) |
||
|
Read IEEE Floating Point value from a double word in a 450 CPU, assign to a numeric variable in the BASIC module, and display. ieeeread.abm (F4-CP128-1) |
||
|
Convert a numeric variable in the BASIC module to the IEEE Floating Point bit pattern and write to a double word in the CPU. ieeewrit.abm (F4-CP128-1) |
||
|
Read Slot Number that the CoPro is Installed In 05 CoProcessor 205 CoProcessor 405 CoProcessor |
||
|
Write a double BCD word with a 405 CoPro 10 X=99999999 10 X=99999999 |
||
|
Read a double BCD word with a 405 CoPro 10 BMOVE R,VH(2000),K(4) _or_ |
||
|
Write a double BCD word with a 205 CoPro 10 X=99999999 |
||
|
Read a double BCD word with a 205 CoPro 10 BMOVE R,VH(2000),K(4) _or_ |
||
|
Wait for an input with a 405 CoPro 10 DO : UNTIL S405_X(0) Print status of an input with a 405 CoPro 10 IF S405_X(0) THEN PRINT1 "ON" ELSE PRINT1 "OFF" |
||
|
Wait for an input with a 205 CoPro 10 DO : UNTIL S205_X(0) Print status of an input with a 205 CoPro 10 IF S205_X(0) THEN PRINT1 "ON" ELSE PRINT1 "OFF" |
||
|
Write a string to a block of V-memory in the PLC F0-CP128 Example F2-CP128 Example F4-CP128-1 Example |
||
|
Read a Block of V-memory from a PLC that contains ASCII codes for a string F0-CP128 and F4-CP128-1 Example F2-CP128 Example |
||
| Updated 1/21/2008 |