LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global and DataSocket

Solved!
Go to solution

My problem is this:
I have to do readings of several machines. The reading is done through a serial communication (and therefore I use the VISA function). These readings are collected by an agent (in this example, Simul machines.vi) which is responsible for distributing, via DataSocket, the reading of each machine to the corresponding agent (DS 1.vi and DS 2.vi).
So far it works perfectly.

The problem arises when I want to view all variables in each of the readings (in this example, "status"):

I 've created another agent (monitor.vi) who reads the array (global variable). This array contains the "status" variable in each of the agents on each machine.

 

Why it doesn't works?

 

 

I enclose a simple example. Run Simul machines.vi (Requires Data socket)

 

 

Thanks

_______________

 

Vicen

LV 7.1 / Win XP

0 Kudos
Message 1 of 5
(3,221 Views)

I've solved the problem, but I don't understand my solution:

 

I needed to insert in the two cases (true and false) the function "Replace array subset".

 

Why? Is not similar placing the function outside the case structure?

 

 

0 Kudos
Message 2 of 5
(3,197 Views)

Hi vicens

 

It isn't possible to execute your code because you haven't included subVI "cut message.vi". Please, attach it.

0 Kudos
Message 3 of 5
(3,181 Views)
0 Kudos
Message 4 of 5
(3,172 Views)
Solution
Accepted by topic author vicens

The image of the code you posted

 

 

is very similar to the example shown below

 

 

THe above images shows a BAD construct and was posted as part of my Action Engine Nugget to illustrate a Race Condition.

 

 

Please review that nugget to see how an Action Engine will prevent race conditions.

 

Just trying to help,

 

Ben 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 5
(3,167 Views)