LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending messages to an event queue

I have a LabVIEW app where I need to save and restore settings. All of my
controls are handled by an event structure. I have already completed the
"save" settings step by collecting all of the relevant variables in a
cluster and handing them off to a subvi that writes them to the config file.

For the restore, I would like to read and set all of the values via local
variables and "programmtically" enqueue a "value changed" event for all of
the relevant controls so that the appropriate event handlers take place,
e.g., update derived values on the display, control external devices, etc..

I realize that I could replicate all of the event code to set the state of
the controls and derived values, but given the amount of logic in the event

structure, I am not at all interested in this brute force labor intensive
approach.

Thanks,

Rob
0 Kudos
Message 1 of 5
(2,961 Views)
If I understand you correctly, you want to set all of the controls on your front panel in a specific order and let all of the logic that currently exists, do all of the work it was designed to do.

Here is one of thoes wild ideas I had that I have not had to opertunity to develop into anything usefull yet.

In a seperate VI, open a connection to the VI you want to manipulate. Get conncetion references to all of the controls you are intrested in controlling in an init state. in another state, take note of each controls state and determine if it has changed. if so, add a desriptor for that control and its refnum to an array of clusters. Repeat this operation noting which controls are manipulated and the new data values.

I have develeoped a quick hack that performs
the above operation (and its compliment) as a quick proof of concept but do not have the code here.

What I was able to do, was have a "learning phase", where the code watched what an operator did. In the re-play phase, all of the controls where manipulated in the exact manner as when operated apon by the operator.

Like I said at the begining, I have never had the opetunity to develop an application that uses this idea, but this may be usefull in your case.

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
0 Kudos
Message 2 of 5
(2,962 Views)
Hi,

I need this!! Smiley Tongue

I'm kind of newbie with LabView but managed to record the actions set on the front panel.

My problem now is how to re-play these actions I recorded in a text file... I have to respect the chronology and the timing between each action...

Any help will be welcomen!!

My dirty code of the recording is in the .vi (labview 7.1)

Sorry for my bad english! Smiley Wink
0 Kudos
Message 3 of 5
(2,751 Views)

golgoth:

I am still missing what you are trying to achieve. From your program, on every value change, you are writting the current value to a text file, along with the timestamp. Are you just trying to read the last value written back or ... Please provide me with more information so that I can better assist you.

Regards,

Rudi N.

 

0 Kudos
Message 4 of 5
(2,726 Views)
I'm trying to record a macro in a text file in order to re-play it later.

To do that, I write (as you understood) each time a control is changed on the front panel, its name, its value and the timestamp in a text file.

Here is an exemple of this text file:

03:21:14    1    Booléen 2
03:21:16    0    Booléen 2
03:21:17    2    Numérique
03:21:20    3    Numérique
03:21:28    1    Numérique
03:21:30    0    Numérique
03:21:34    1    Booléen
03:21:36    0    Booléen


My problem is the re-play of this macro. I understand how to extract timestamp, value and the name of the control.

Even if I don't how to do it, I think I'll have to use a "timed loop" to keep the timing of the sequence.
But I don't know to successively and automatically fire if you look at the text sample the Boolean n°2 then 2 sec later de-activate it then 1 sec later put the numerical control to the value 2, then ....

I'm sorry if it's not very clear, please apologize my bad english!

THX!

0 Kudos
Message 5 of 5
(2,721 Views)