We just completed the conversion of a PLC 5/80 to a 1756-L8x processor. The old 5 program had numerous MSG instructions sending data to/from other PLC5s. Most all of the MSGs were sending INT data.
The converted CLX program changed all of these data tables into DINT array tags, which is fine. For any of these being sent to a PLC5, I then used an FAL instruction to convert the DINT elements as an INT array buffer prior to executing the write MSG.
A problem occurred as some of the old PLC 5 registers were used for boolean data storage rather than integer values. So, if N10[0].15 = 1 in the Logix program, the FAL instruction would error out trying to convert 32768 to an INT.
I ended up working around this by finding the dozen or so DINT elements where this was an issue and added a rung of logic to essentially mimic the value of bit 15 to bits 16-31 in that same element. This didn't seem very pretty but it got the job done.
Are there any instructions perform this conversion or other/better ways to avoid this error that I didn't come up with in my moment of crisis? Thanks in advance.
The converted CLX program changed all of these data tables into DINT array tags, which is fine. For any of these being sent to a PLC5, I then used an FAL instruction to convert the DINT elements as an INT array buffer prior to executing the write MSG.
A problem occurred as some of the old PLC 5 registers were used for boolean data storage rather than integer values. So, if N10[0].15 = 1 in the Logix program, the FAL instruction would error out trying to convert 32768 to an INT.
I ended up working around this by finding the dozen or so DINT elements where this was an issue and added a rung of logic to essentially mimic the value of bit 15 to bits 16-31 in that same element. This didn't seem very pretty but it got the job done.
Are there any instructions perform this conversion or other/better ways to avoid this error that I didn't come up with in my moment of crisis? Thanks in advance.