05-08-2017 07:23 AM
Hi,
I have a double array that is feed inside the producer loop. I want to display all data of the array in a sequence to the data indicator but the element inside the event structure can not be triggered. I don't want to use the timeout of the event structure.
What do you think is the problem ? and what is the solution?
vi is Attached. Thanks!
jK20
Solved! Go to Solution.
05-08-2017 08:08 AM
A value change event is trigger whenever the user enters new data into a control, or you programmatically write data to a Value(Signalling) property node.
You don't have any of those property nodes, and your Data array is an indicator, not a control, so there is no way for you user to enter data into it.
05-08-2017 08:18 AM
Hi jK,
What do you think is the problem ?
The problem is you are waiting for a value change event of an indicator "data". Indicators will NEVER create valuechange events (unless you use a special property node)!
and what is the solution?
You should wait for your user-defined event instead…
05-09-2017 12:17 AM
Thanks Raven.
But Unfortunately when I used property node (value) (initial value say = -1), the event has not been triggedred as well.
Please help. (screenshot attached)
Regards,
Wilmar
05-09-2017 12:19 AM
hi GerdW,
I did your suggestion to put initial value in the property node value, but got no luck. The event does not recogized it.
I have no idea with user defined even and how to implement it.
Thanks
Wilmar
05-09-2017 12:19 AM
hi GerdW,
I did your suggestion to put initial value in the property node value, but got no luck. The event does not recognized it.
I have no idea with user defined even and how to implement it.
Thanks
Wilmar
05-09-2017 12:45 AM - edited 05-09-2017 12:56 AM
Hi jengkamK20,
Looking at your VI, despite the helpful comments, it's really not clear which loop is really the consumer!
Your producer labelled loop reads the data (presumably this array + 100ms wait simulates a 10Hz data source) and then you want to send it to the 'data' indicator, is this right?
The consumer doesn't consume the data. Instead, it seems to be just passing it back to the producer, which has to then both produce and consume! It's not surprising that the loop is difficult to work out.
If you want to use a Queue with the producer (this is the normal P/C Data structure) then don't make the enqueuing of data conditionally depend on the execution of the Event Structure. In the top producer loop, if the Event Structure doesn't trigger, then the loop iteration never finishes (as you're seeing). If you remove the Event Structure then the loop will enqueue an element with no problem. Then, the consumer can dequeue the element and place it in the 'data' indicator.
Alternatively, if you want to use User Events, then you need to be clear about where you want data to start, go to, be processed and so on. If the producer generates the data and you want to handle it based on the event, you should generate an event when the data is 'produced' - perhaps by placing a Generate Event node outside of the Event Structure. Then, changing the Event Case to be the dynamic user event will work (and you can keep your data indicator in the event structure). Note, that in this case, your consumer isn't involved at all (and further, you're making a very convoluted setup that could be replaced by a simple wire...)
It's pretty likely that this is a test VI to check how things work, or to explore the tools available in LabVIEW, so something being convoluted is fine if you know how you want to use it in future. Just make sure you know what you want to happen where!
Edit: I attached a VI which compares Queues with Events. Neither of the cases I show uses both, although you can if you want/need to.
05-09-2017 08:25 AM
@jengkamK20 wrote:
hi GerdW,
I did your suggestion to put initial value in the property node value, but got no luck. The event does not recogized it.
I have no idea with user defined even and how to implement it.
Thanks
Wilmar
I didn't say Value property node. I said Value (Signalling). The "signalling" part is the one that tells it to fire an event.