GE Fanuc SNPX driver
BIG FAT WARNING:
This is pre-alpha code and information.
You assume all responsibility for its use.
DANGER: DON'T connect to a PLC unless you are certain it is safe to do so!!!
It is assumed that you are experienced in PLC programming/troubleshooting
and that you know EXACTLY what you are doing. PLC's are used to control
industrial processes, motors, steam valves, hydraulic presses, etc.
You are ABSOLUTELY RESPONSIBLE for ensuring that NO-ONE is in danger
of being injured or killed because you affected the operation
of a running PLC.
Also expect that buggy drivers could write data even when you expect that
they will read only !!!
This driver talks GE Fanuc's SNPX protocol. The protocol is described
in a document gfk0582d.pdf which is can be found on GE's web site.
Somebody may check if the driver fully conforms to this, because I did it
knowing that document. I just watched communication between PLC and
Because the programmer interface of the PLC uses RS485,
you need a converter. Converters are widely available from several
The SNPX protocol supports multiple PLCs connected to the same bus.
In order to use this, each PLC must be assigned an indivdual SNP-ID.
This can be done with GE's programming/configuration software.
A PLC responds to a message either when the SNP-ID field is identical to it's
own SNP-ID or left blank.So, if you leave it blank,
all PLCs will respond.
This is supported by the driver in the following manner:
The driver assumes that you have a spreadsheet for each PLC.
The driver accepts a first and last sheet number.
You specify a cell coordinate containing the SNP-ID. This must be a text cell.
The driver then executes the transfer instruction for each sheet in the given
range taking the (hopefully different) SNP-IDs from this cell.
The driver can read and write the following data types:
Be carefull when writing single bits! The underlying protocol writes a whole
byte at a time. To achieve bit writing, the byte is fetched first, then the bit
is set or reset and the byte is written back. Because the data exchage is
in no way synchronized with the PLC's execution cycle, the PLC might have se
reset other bits in the same byte in the meantime. Writing back the byte will undo
these changes, producig strange effects. In other words: Bit writing is ok long
as your PLC program uses all bits in this byte READ ONLY.
|opening object tag||object properties|
||SNP ID cell
||Closing object tag
||'This reads MW0..MW10 to D3.. if C3 is<>0'
|| 3|| 0|| 10 ||0
||'This writes from C3.. to MW0..MW10 to D3 if B1 is<>0'
|| 3|| 0|| 10 ||1
|Comment||Anything you want||Use it to remeber the purpose of the line|
|First sheet||1..last sheet||First spreadsheet used|
|Last sheet||1..last sheet||Last spreadsheet used|
|First address||PLC address range||Start address in PLC|
|Last address||PLC address range||End address in PLC|
|Direction||0 or 1||0 means read,1 means write|
|0||Bits from outputs memory image|
|1||Words from inputs memory image|
|2||Bytes from inputs memory image|
|3||Bits from inputs memory image|
|First cell||A1..NTP10000||First cell cooresponding to first address. Next data elements go to or are taken from cosecutive rows.|
|Condition||A1..NTP10000||A cell which must have numerical contents non zero in order to execute the transfer.|
|SNP ID||A1..NTP10000||A cell which contains the SNP ID of the PLC.|
All PLC drivers use blocks of data. The first and last element in PLC memory
are used to specify a block. For the corresponding area in the spreadsheet,
the first cell coordinate is specified. Further data elements are copied to
or taken from consecutive row of the same column.
The driver transfers data for each instruction.
If you use for example register words 1111 to 1115 and words 1118 to 11120
,it is faster to read words 1111 to 1120 as one block and just do nothing with
words 1116 and 1117.