LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer consumer state machine communication

I'm programming a RT system with 3 drives which are accessed through the scan engine. 
To control the entire system I have a producer state machine ("Command Loop") and for the drives I've created another state machine  ("Motion Loop") which acts as consumer (see picture).
The Motion Loop gets it's Information passed via a RT shared variable fifo. But I would also like some control over the Motion loop when it's idle. 
I've thought about using the event structure but am not sure if thats the best method.

 

I know LV offers several methods for me to communicate between loops, but is there a recommended method for my case?

 Unbenannt.PNG

 

0 Kudos
Message 1 of 8
(1,610 Views)

I don't see anything that is being handled as time critical, so I would just use a queue.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(1,597 Views)

Hello schpongo,

 

you can use a different framework like this from Delacor, which has the communication options inside

https://www.youtube.com/playlist?list=PLZ3A_SIOKdQs73IjbtaWwCSqoxQfxlWj6

or you can extend the JKI statemachine like wrote with a queue or custom user events or notifiers.

best regards
Alexander
0 Kudos
Message 3 of 8
(1,565 Views)

@crossrulz wrote:

I don't see anything that is being handled as time critical, so I would just use a queue.


I'm not sure whether the communication between my AKD EtherCAT drives and the Motion Loop should be considered as time critical. 
If it is, should I maybe consider using a RT FIFO instead of a queue?

The DQMH structure looks very interesting, but for the moment being I'm a bit short on time to look into it, but thanks for the tip.

Daniel

0 Kudos
Message 4 of 8
(1,555 Views)


I'm not sure whether the communication between my AKD EtherCAT drives and the Motion Loop should be considered as time critical. 


Can you show me the communication code mentioned here?

0 Kudos
Message 5 of 8
(1,546 Views)

Hello schpongo,

 

now we are on a point where it is important to know what you want to do, becasue RT FIFO makes only sense, when also a timed loops will be used typical this means you want to make a controled closed loop.

 
best regards
Alexander
0 Kudos
Message 6 of 8
(1,539 Views)

Use “User Events” to communicate into the Event Structures of your JKI “state machines”.  Use one User Event each, containing a cluster of a string (command) and a variant (data).

0 Kudos
Message 7 of 8
(1,530 Views)

My current concept is based on one controlling loop which interpenetrates different user commands and commands which are read form a text file. 
All the hardware which I need to control is supposed to be modeled as state machine. 

The Motion loop is supposed to control 3 AKD drives via EtherCAT. Thus I thought about putting it in a timed loop so I could more tightly control how fast it runs maybe sync it to the scan engine rate.

 

At the moment I only plan to use the queue to initiate different automated processes for each of the state machines. So that they are in an idle state until they receive a certain command and then loop through different states.

0 Kudos
Message 8 of 8
(1,502 Views)