09-25-2021 04:44 AM - edited 09-25-2021 04:56 AM
I am thinking about VI control remotely with two applications (A.exe / B.exe) as shown in attachment.
A.exe is designed for batch-work in some set of different paramters and need to control 3rd application as well as B.exe.
B.exe is verified and tested to control some intruments.
B.exe consisted of producer-consumer and event structure was used in the producer.
In B.exe, each button is assigned to the event:value change.
But I have no idea how can I realize the "event:value change" with minimal codes/variables when an user-event is arrived on B.exe from A.exe.
In my rough idea, may be I can use "value(sgnl)" property of the button.
I can checked this idea is working but I have never seen this kind of solution in example codes in this forum.
Because of several buttons (event), I am wondering if this code is well maintained in editing the overall code easily in future.
Can anybody guide me to take some idea for improve the structure?
labmaster.
09-25-2021 10:04 AM
From your very brief sketch and even briefer "picture of a piece of the Block Diagram", it is not clear to me what Design Pattern you are using for your "Server", B, nor how you are communicating between A and B (two-way? one-way? some form of TCP? VI Server?).
Have you looked at LabVIEW's QMH Design Pattern, or considered the Delacor DQMH design? These discuss using "Messages" as a way to transfer data from an Event Loop to the underlying Message Handler without requiring Value Changed Events. Do you have any experience with LabVIEW Real-Time, where there are definitely two independently running LabVIEW routines on separate processors, with communication generally through some form of TCP/IP, with Network Streams getting pretty good marks?
Bob Schor
09-26-2021 11:23 AM
@labmaster wrote:
I can checked this idea is working but I have never seen this kind of solution in example codes in this forum.
It's working! That's always a good first step. As Bob already said, there are way too many open question to really give detailed advice.
You talk about A.exe and B.exe. Are these two different VIs running under LabVIEW or is each a built standalone executable running independently?
Your code looks relatively clean and well organized (from the very limited views). One thing to keep in mind is that signaling value properties fire a "value change" event even the the old a new values are the same, so you might want to deal with that possibility in these events if it is of concern.
09-29-2021 08:16 AM
Thank you all.
Two different applications are executed independently in the same computer via VI reference with functional global.
I have little experience with OOP programming and I have frequently used producer-consumer structure.
Sometimes, a control assigned an event can be modified as an indicator.
In this case, I had to use local variable of the control or "value" or "value signaling" property.
In small project, no problem because of minimal use of variables.
However, in this project, I have to design with too many batch works (= too many number of value signaling for every incoming user-event) to send the value or work to the independent process program (A.exe) from batch program (B.exe).
By using an "value signaling" event structure nested in state machine structure, I can realize the similar code but I have to use extra local variable or "value" property to indicate the current value produced by process instead of using "signaling" property.
If there is no problem in using "value signaling" property in memory or other possible systematic issues, may be I can use them.
labmaster.