I am working on a device that is hooked up to our PLC through ethernet/IP and an EDS file. The device works by taking the pressure you want and converting it to binary (through an formula in the manual). Once you have the binary value, you need to input the value into two different tags bits to get the desired output.
I have everything set up to get the number switched into binary but now I don’t know how to input that into the tag bits.. any ideas?
There should be no need to write to individual bits in the PLC if you're writing what amounts to a value.
Yes, I'm going on a limb here but... Is this calculation right? It's looks like Byte 1 is supposed to be the integer and byte 2 is the decimal? If so, you are missing bit 5 on Byte1.
Also if so:
Option 1: make two integer expressions and write them separately to each SINT:
Option 2: Write the full calculated integer to a UINT on the PLC and COPy it to Reg1:O and let the PLC handle the distribution. ({[.]Desired Pressure)-floor({[.]Desired Pressure))*2560 + floor({[.]Desired Pressure)
Rather than trying to write individual bits from Ignition I'd just write the integer value across into a PLC temp tag first and then have the PLC logic assign the bitwise logic into your final tag.
Concur. Just arrange to copy an INT into the first two bytes. The manual implies the high bits are ignored. Use Ignition's linear tag scaling to do the conversion to 0-4095 for you, and enable the clamping option.