LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tags write before reading from tagengine

My tag engine is setup with ± 800 tags linked to RSLinx opc server. I have ± 2500 ctrls linked to these tags on different windows.

When my program start, many of the analog values are overwritten by 0. It seems as if the ctrls publish data before receiving any values from the tag engine.

I've tried putting a 2 sec delay between the loading of the windows to give all the tags a chance to link and receive data. - Doesn't help. Critical data is still being overwritten. They are numeric ctrls with connection set to publish and subscribe. Most of it are never used in the code, only to display and change values.
0 Kudos
Message 1 of 5
(3,012 Views)
This looks like you have the initial value option selected in the Tag Configuration Editor. Check to ensure that this is not the case. Select Tools>>Datalogging and Supervisroy Control>>Configure Tags. Choose the tag you need to verify and select Edit Tag. On the Operations tab (upper section) ensure that the "Set Initial Value" box is unselected.
0 Kudos
Message 2 of 5
(3,012 Views)
I exported all the tags to excel (csv) and sorted by that column, but it doesn't look as if any tags have that option selected.
0 Kudos
Message 3 of 5
(3,012 Views)
I tested this using our Lookout software as the OPC server. Every time I run it, the control subscribes first and publishes second. Try the following:
1. Create and connect a single numeric tag to your OPC server.
2. Create a numeric control in a new VI with a sub/pub datasocket connection. Change the initial value to something other than zero.
3. For the diagram, place the numeric control in a while loop.
4. Run the VI, and you'll notice that the control changes is value to the OPC server's value.

If this works on the same machine, then this is most likely a problem with your code.

Regards,
Michael Shasteen
Applications Engineering
National Instruments
www.ni.com/ask
1-866-ASK-MY-NI
0 Kudos
Message 4 of 5
(3,012 Views)
If you only use 1 tag your theory stands. However, when my app starts, it raises CPU usage to 100% for up to 30 secs while connecting the tags. This shouldn't have any effect on the situation, but when I run all of these windows individually, the problem doesnt occur.

After watching it more closely it seems to be all analog tags linked as "Publish & subscribe" that are not specifically given a value in my code.

Changing the initial value have no effect. I've also double checked that they are used nowhere in the code. The "set initial value" value is not selected for any tags - exported to excel and compared it there as well.

Removing and re-adding them to the taglist also have no effect.
0 Kudos
Message 5 of 5
(3,012 Views)