Writing To Several Channels At Once Within A Sequence


Recommended Posts

I'm trying to write to several channels at once within a sequence, They are all configured as analog outputs pointing to a Top Server OPC server.

When I write to several at once only the first one seems to be set correctly, The others seem to be set to the previous value already sent.

 

I wrote a little test sequence to test this as detailed below, (testing_variable is a global variable setup in a startup sequence)

 

Fridge1a_Control_out = testing_variable
Fridge1b_Control_out = testing_variable
Fridge2_Control_out = testing_variable
Fridge3_Control_out = testing_variable
testing_variable = testing_variable+ 1
 
When I run this several times the Fridge1a_Control_out channel always has the correct value but the others are always one value behind.
Both the real OPC tags and the DAQ Factory channel table display for each channel indicate the same.
I've also checked the log of commands sent from DAQ Factory to the OPC Server and it indicates each time a write request is made for 4 addresses but again with only the first value being correct.
 
If I put a delay(1) in between each channel write it actually works without any problem, But I've got quite a few sequences to write with many channels requiring values to be changed and these delays really slow it down too much.
 
 
Hopefully someone can shed some light on what I might be doing wrong.
 
Thanks.
 

 

Link to comment
Share on other sites

There's probably something going on that is not obvious from seeing just your script.  My first suggestion is to make sure each OPC channel has a different Channel #.  If that doesn't work I'll need to see your .ctl document.

Link to comment
Share on other sites

I've attached a basic project, Just with the 4 channels and a couple of buttons on display.

I've also attached a screen shot of what I see when I toggle the buttons a few times, The data inside the PLC which the OPC server is attached to corresponds with log on the display.

 

Thanks.

test_4_writes.ctl

post-11829-0-22902400-1436432486_thumb.j

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.