LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

excessive writes to shift registes using shared variable for modbus

Does using Shared Variable for Modbus (tcp/ip) preserve a controller write to its registers (i.e. Watlow PM Controller)?  The Watlow PM manual mentions I should NOT use excessive writes in a loop. Its capable of 1 million rights and no garantee after that.
 
I'm assuming yes since Shared Varaible changes only occur when there is a change in shift registers. If I have shared variable controls inside of a loop and no change in value, this does not cause excessive writes correct???
 
 
0 Kudos
Message 1 of 4
(2,456 Views)

OK, whether writes are saved is configurable in the controller.

But, my  problem is whenever a change is made to a register in the controller using Shared Variable, the variable keeps updating (writing) after that. I know from a boolean register called "Updating" in the controller that turn on whenever there's an update. I tried using event structure and no change in the Shared Variables multiple attempts to update whenever I make a change (write to a register).  I have to start and stop the VI to see my update value. I'm using Modbus over TCP/IP.

I need to find more info on how Shared Variable is used with Modbus, specifically writing to a register without doing multiple writes. Intuitively thinking, it should be trivial...make a change to the Shared Variable the change is made in the register address. Instead a change in the Shared Variable results in endless update to the register address.

richjoh

0 Kudos
Message 2 of 4
(2,424 Views)

Hi richjoh,

Could you explain a little more how the event structure was set up and what the behavior was?  That seems like a good way to detect a change and then write to the register.

You mentioned shift registers in your first post.  Are you using a shift register to compare the previous value of each shared variable to the current value and only update the register address when there is a difference? 

If you are able to post your code, that may help as well. 

Jennifer R.
National Instruments
Applications Engineer
0 Kudos
Message 3 of 4
(2,394 Views)

Jennifer_R thanks for the response. Let me correct whats going on here, my controller begins polling after a register change not writing, see this post.... http://forums.ni.com/ni/board/message?board.id=170&thread.id=292301

richjoh

0 Kudos
Message 4 of 4
(2,374 Views)