Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus ini setting: OptimizeWrite

What does this do?

My problem is that i am using remote connections to the modbus object. and the remote is overwriting my new value.

example of my problem
Lookout=0, plc=0
poll
OK
Lookout=1, plc=0
Poll
WRONG:  plc overwrites lookout, now making the value in lookout 0


any ideas, ive been dealing with this for a couple years, and its getting irritating.  maybe a new setting to make the outputs go first, then poll.

thanks
mike


Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 1 of 6
(7,015 Views)
The OptimizeWrite is false by default. If you set it to 1, modbus will optimize the write function. It will avoid some unnecessary write from Lookout to plc. It just improves the performance.
 
Below is my test.
 
If "immediately write outputs" is checked, the write command will immediately be sent out after you change the value in Lookout. I can't see the problem in this condition.
 
Then I uncheck it, and set a long time to "Poll". I see this behaviour,
 
Lookout 0, plc 0
Lookout 1, plc 0
Poll
Lookout 1, plc 1
Lookout 0, plc 1,  Lookout pot snap back
Poll
Lookout 1, plc 1
 
I think this is the correct behaviour. PLC doesn't overwrites Lookout, but Lookout pot snaps back. In the next poll, Lookout pot get confirmation from plc and set its value to 1.
 
 
 
Ryan Shi
National Instruments
0 Kudos
Message 2 of 6
(7,001 Views)
Lookout 0, plc 0
Lookout 1, plc 0
Poll
Lookout 1, plc 1
Lookout 0, plc 1,  <-- The PLC should be sent the 0 correct?
Poll
Lookout 1, plc 1

The PLC was 1 and Lookout 0, why did the PLC not get changed to 0?

Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 3 of 6
(6,996 Views)
In modbus object's property->Advanced, do you check "immediately write outputs"? I think if you check it, lookout will immediately write the value, it will not wait for the next poll.
 
Can you make a log file on serial port? The logged data may help to debug.
 
Also want to know in which condition this problem will occur. I guess that it doesn't occur on all addresses pr all devices.
Ryan Shi
National Instruments
0 Kudos
Message 4 of 6
(6,984 Views)
If I uncheck "immediately write outputs", set UpdateOutputs=2, I guess I have reproduced your problem.
 
It writes data in the first poll, but doesn't write in second poll, because UpdateOutputs = 2.  The address is read/write, in the second poll, it doesn't write but it reads. So it reads 1 from plc and updates.
 
I will do more investigation to see if this is incorrect or not.
Ryan Shi
National Instruments
0 Kudos
Message 5 of 6
(6,981 Views)
It happens with write immediately checked also.

my other modbus post is a little more important though, i can work around this one.
http://forums.ni.com/ni/board/message?board.id=190&thread.id=5291

But what does OptimizeWrite really do?

Thanks
Mike
Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 6 of 6
(6,969 Views)