Omron PLC Plugin

Purpose

Purpose of this plugin is to read from Omron PLCs, using the FINS protocol.

Usage

You run a log to send data to the cloud, or a discover to only display information. There must be a config file when running log or a discover. The config file defines which variables need to be collected, what names they appear on the the Ardexa cloud, units and scaling, what table(s) they variables will be sent to, and the source name(s). Example config file as follows. Always verify data accuracy by running a discover first, before committing the plugin to collect data.
1
# Table, Source Name, Variable Name, Memory Location, Type, Units, Scale, Invalidate, Lookup Table
2
hydro, hec, AC Voltage 1, 20015, dec, V, 1+10, ,
3
hydro, hec, Grid Freq, 20016, dec, Hz, 0.01, ,
4
hydro, hec, Cos Phi, 20017, dec, , 100, ,
5
hydro, hec, PT100 Temperature, 20018, dec, C, 1, ,
6
hydro, hec, Total Hours, 20019, dec, h, 0.1, ,
7
hydro, hec, DC Current 1, 20030, dec, A, 1, ,
8
hydro, hec, HDG Setpoint Mode, 20031, bitb, , 1, , 1
9
hydro, hec, Run Auto, 20032, bitb, , 1, , 2
10
hydro, hec, Run Manual, 20033, bitb_int, , 1, , 3
11
hydro, hec, Key Switch, 20040, str, , 1, , mode.dict
12
hydro, hec, Key Switch2, 20045, str_rep, , 1, , mode.dict
13
hydro, pid_box, PV- Voltage, 20050, int, V, 1, ,
14
hydro, pid_box, PV- Current, 20051, int, mA, 1, ,
15
hydro, alarm, Alarm 0 Keyword, 20061, bit, , 1, , container_alarm0.dict
16
hydro, alarm, Alarm 1 Keyword, 20062, bit, , 1, , container_alarm1.dict
17
hydro, alarm, Alarm 1, 20063, bool, , 1, ,
18
hydro, alarm, Alarm 4, 20064, int_bool, , 1, ,
19
hydro, hec, Total Current, 20065, dec, h, 0.1, >100000,
20
hydro, status, Binary Status Raw, 20066, bin, , 1, ,
Copied!
NOTES:
  • Anything that starts with # is a comment line, and will be ignored
  • The Memory Location is the Ormon memory location/address.
  • Scale will only be used for decimal and integer types. An error will be reported if you try and divide an integer, or multiply by anything other than a whole number. The scale can also be a value such as 0.75-9, where the -9 is a BIAS value (addition or subtraction). In which case it will FIRST subtract the 9, THEN multiply by 0.75. If using a bias value, then it can ONLY be used with a decimal type.
  • Invalidate. This column will only do the following task": If an entry starts with >, it will invalidate ALL entries in a configuration file, if the value for this entry is greater than the specified amount. For example; if the Invalidate column entry is >10000, then a value of 12,000 will ensure ALL readings in the configuration file are invalidated. Use this item with caution. Also, it will ONLY work on dec values. This invalidation feature is intended for those machines that have poor quality control, and sometimes transmit wildly wrong values.
  • In Lookup Table; Sometimes you want to convert an INT to a keyword, through a lookup table. Or you may want to get a register bit and convert it to a keyword. See examples below.
  • Allowable Type column values are as follows:
    • dec ... Converts the Omron memory location to a decimal. Can be scaled (including division).
    • int ... Converts the Omron memory location to an integer. Can only be scaled upwards (not divided). So a scale value that is not a whole number will be rejected.
      1
      See also the explanation for `scale` above, since it can include a bias and scale factor.
      Copied!
    • bool ... Omron memory location is converted to an INT. This value is then check as follows: Anything other than 0 will output a True. Else, output will be False.
    • int_bool ... Omron memory location is converted to an INT. This value is then check as follows: Anything other than 0 will output a 1. Else, output will be 0.
    • bin ... Converts the Omron memory location to an integer, then to a binary representation.
    • bit ... Used with a lookup table (in the Lookup Table column) to define a bit being turned or off. See example contents of file below.
      1
      Bits start at "1" (not "0"), and are defined in the `Lookup Table` column.
      Copied!
    • bitb ... If a bit in the Omron memory location is turned on/off, it will reflect a boolean ("True"/"False") output.
    • bitb_int ... If a bit in the Omron memory location is turned on/off, it will reflect a boolean ("1"/"0") output.
    • str ... Treated as an ASCII character. If it can't be converted, it will output an empty field
    • str_rep ... Same as str, but it will clear \0 values in the resultant string.

Arguments

  • ip_address This is the IP Address of the Omron PLC. Make sure that Port 9600 is open.
  • config_path. This is the config file location
  • --attempts Is the number of attempts to make to get data from the PLC. The default=2

Example of "bit" lookup

Bit starts at 1. Include a 0 value to display something (or blank) if no bits are turned on
1
0 :
2
1 : electric leakage sensor#1
3
2 : AC surge protection device
4
3 : key-operated switch
5
4 : scram button
6
5 : switcher signal from UC PCB Control Board
7
6 : electric leakage sensor#2
8
7 : electric leakage sensor#4
9
8 : electric leakage sensor#3
10
9 : signal 8 abnormal
11
10 : energy-saving contractor KM1 return signal
12
11 : electric bad leakage sensor#2
13
12 : electric bad leakage sensor#1
14
13 : electric bad leakage sensor#4
15
14 : electric bad leakage sensor#2
16
15 : signal 14 abnormal
17
16 : signal 14 abnormal
Copied!

Example of "str" lookup file

Numbers can be anything, since they are read from a single Omron memory location
1
-1 :
2
51 : Closed
3
267 : Inverter
4
276 : Instantaneous value
5
295 : MPP
6
303 : Off
7
308 : On
8
309 : Operation
9
311 : Open
10
336 : Contact the manufacturer
11
337 : Contact the installer
12
338 : Invalid
13
381 : Stop
14
455 : Warning
15
569 : Activated
16
1041 : Leading
Copied!