LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I send data from a flat sequence structure into a state machine???

Hi guys,

I need some seroius help. I am using Ontrak ADU interfaces and I need to send signals generated using a flat sequence structure into a state machine. i have tried many different combinations of things but the program keeps crashing.

My VI is attached. Thanks in advance 

 

JB

0 Kudos
Message 1 of 6
(3,223 Views)

We need more information. It seems you have a gigantic flat sequence and in the last frame you have some sort of a state machine.


Jules Verne wrote:

... and I need to send signals generated using a flat sequence structure into a state machine.


 

 Why kind of signals do you want to "send", and exactly from "where" to "where"? Tell us at least where to look!


Jules Verne wrote:

i have tried many different combinations of things but the program keeps crashing.


 

Can you define what you mean by "crashing" are there any error messages? 

 

(The second while loop seems to have no purpose, can you explain why it's there?)

0 Kudos
Message 2 of 6
(3,217 Views)

JB,

 

The style guides recommend keeping the diagram to the size of one screen.   Wish I had your screen!

 

Why not put the code in the first three frames of the sequence into states of the state machine?  Then it would be easy to pass the data via shift registers.  And you get rid of the sequence structure! Since you already have a state machine, use it.

 

You are not using error clusters, so you may be missing clues about the cause of your crashes.  What part of the program is executing when it crashes? 

 

Lynn 

0 Kudos
Message 3 of 6
(3,216 Views)

Thanks for answering so promptly  guys... Greatly appreciate it

 

More background on this project:  Being fairly new to LabView I have been given the task (challenge) to program a prototype pH Neutralization system. All the different states of this process can nicely be controlled using a state machine approach. We are using two Ontrak USB Interfaces, the ADU100 (For three analog signals, 4 to 20ma) and the ADU 200 (for discrete inputs, relay output). The ADU100 only has one A/D chip which needs to be "polled" in order to be able to use the analog signals, that is why I used the flat structure sequence: open the chip, get 1st signal, close chip, open chip, get 2nd signal, close chip, open chip one more time, get 3d signal, close and repeat cycle. I have been able to read this signals by themselves using this approach. But I do not know how to make it work using along with a state machine. The program runs for a while and then stops, always showing the same message; " internal error has occurred. Do you want to debug?".

 

Thanks again

 

JB

 

0 Kudos
Message 4 of 6
(3,197 Views)
I forgot to mention the 3 analog signals will be used by some of the states in the machine and their values continuously displayed on the front panel as temperature, ph and level ....
0 Kudos
Message 5 of 6
(3,195 Views)

JB,

 

To add the  ADU devices to your state machine create states for "open chip," "get nth signal," "close chip," and similar states for the ADU 200.  Pass the value of "n" and the results of the measurements from one state to another via shift registers.  Your initial sequence of states (assuming no errors or other unusual events occur) might be: "Idle" set n = 1, "Open chip," "Get signal <n>," "Close chip," "Idle" set n = 2, "Open chip," "Get signal <n>," "Close chip," "Idle" set n = 3, "Open chip," "Get signal <n>," "Close chip," go to the first state of your current state machine. 

 

Lynn 

0 Kudos
Message 6 of 6
(3,165 Views)