From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-12-2011 11:07 AM
HI,
I am working with jki state machine. I have problem with my case structure. I have two case structures, one inside other and a while loop at outside with inside case structures. I written some code in case structure(first state of the state machine) which outputs as true or false are connected to another case structure selector terminal. If the code returns false first time I would like switch it to another state. If the code(first state of the state machine() returns false second or 3rd time or more(or after some true outputs), I would like to switch another state. Can some one suggest me some idea. I spend lot of time on this and could not able to figure out.
09-12-2011 11:17 AM
Keep another boolean state in a shift register or feedback node. Initialize as TRUE and switch it once the "first time" has happened. Use boolean operations ("First time" AND "boolean state") to switch only if both are true.
If is typically much easier for us to help if you attach some code. It is much easier to understand than long descriptions... 😉
09-12-2011 11:46 AM
I am learning labview at the moment and I don't understand your suggestion quite well. I just want do something when I read false first time to case terminal(if I read true many times and then false then I want to some other thing only in that false case).
09-12-2011 11:51 AM
Is this a joke? Why would you typecast a boolean array to a boolean?????
Attach your VI, not code pictures
09-12-2011 12:02 PM
I am getting boolean array which i want to connect to case terminal of different type. So, that is the only reason i converted that 1D array to scalar value by typecast. Please let me know, if there are more mistakes. As i told before about first time false condition. You can see that in Read RAM state, there, i need to switch another state if i read false first time(Thats means when DAQ read state run only first time) and if this states run more than one time and if it returns false i want to switch to another state. I am not going to attch sub vi's here.
09-12-2011 12:25 PM
I think I understand your question but I am not too sure what you want to accomplish. Depending on what your goal is you might be able to use the "First Call" function in LabVIEW. It can be found under synchronization.
09-12-2011 12:32 PM
Hello,
Can I use that "first call" option in a case structure of having many cases. So that, I can use return true value of "firstcall" option when a case of case structure runs for the first time after i start the run VI button.
09-12-2011 12:36 PM
yes
09-12-2011 12:46 PM
I thought that I can use that firstcall option but I have a situation that, I need to switch to two different states in false case of that inside case structure of DAQ read state. If inside case structure terminal encounters false when "DAQ read state" runs first time, I want to switch to "fixed state" but if inside case terminal hits true first time and false second time(in this situation of false case, I would like to switch to eeprom write state). please suggest any other way.
09-12-2011 12:50 PM
Then you'll need to use a shift register or feedback node as Altenbach suggested in the earlier reply to store the information from iteration to iteration as to what the next case might possibly need to be.