I am stuck on what is likely a misunderstanding of how Omron handles data versus Rockwell.
I need to scale an analog input to monitor the position of a joystick. My attempt at doing this is as follows:
* 203 &100 D1700
* 203 &100 D1704
/ D1704 D1700 D1708
D1700 is "zero value", stored once as a calibration check. It is a one time calibration to save the analog input for when X=0. The unit I am connected to is battery operated and as such I am wanting to be able to watch for a drift in the analog input if the battery voltage drops.
The *100 is meant to move the decimal place over by two for when I do a divide later on.
D1704 then represents the "current value" of the joystick position
D1708 is the ratio of D1704/D1700. Values less than 100 (1.00) representing the analog joystick moving left, values greater than 100 representing the joystick moving right.
Problem is my data in D1708 is garbage. All three data types above are currently DINT.
I need to scale an analog input to monitor the position of a joystick. My attempt at doing this is as follows:
* 203 &100 D1700
* 203 &100 D1704
/ D1704 D1700 D1708
D1700 is "zero value", stored once as a calibration check. It is a one time calibration to save the analog input for when X=0. The unit I am connected to is battery operated and as such I am wanting to be able to watch for a drift in the analog input if the battery voltage drops.
The *100 is meant to move the decimal place over by two for when I do a divide later on.
D1704 then represents the "current value" of the joystick position
D1708 is the ratio of D1704/D1700. Values less than 100 (1.00) representing the analog joystick moving left, values greater than 100 representing the joystick moving right.
Problem is my data in D1708 is garbage. All three data types above are currently DINT.