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.
11-01-2012 04:06 AM
Hey Guys
I learned alot from the last feedback in this forum, so i call upon you one more time. This is properly yet another trival question, but im also willing to learn.
A bit of recap: Im using a QSM to control a research setup im using. Now i want to put customized sequences in the queue for special experiments. I've made code that does this and it works fine. Basically i make an array filled with enums that describe my state, and queue each enum using a for loop.
For "hardcoded" sequences the approach above is fine, but if i want to make custom sequences how would one go about doing that. Using what i've learned last time i made the attached code. It can make custom arrays using buttons to imput predetermined sequences. When im done, i want to write the sequnece to a file for documentation but instead of writing what is in my enum it writes the corrosponding number. While this isn't impossible to decode, if feels rather clumsy. Can anybody fix the problem of writing to the file correctly or suggest a different and better approach
kind regards
Atamsih
Solved! Go to Solution.
11-01-2012 04:19 AM
Hallo Atamsih,
to convert an enum to string you should use FormatIntoString:
but instead of writing what is in my enum it writes the corrosponding number.
Well, what do you expect when you explicitely convert your array of enums to an array of U64?
11-01-2012 04:29 AM
Hello GerdW
I tried the FormatIntoString, however, it does not accept an array of enums. Could you modify or suggest how to improve my code that it will?
I must i admit i do not know what to expect. im new to LabVIEW. Could you direct me to a tutorial that explains its?
Kind regards
Atamsih
11-01-2012 04:34 AM
Hi Atamsih,
yes, FormatIntoString doesn't allow arrays as input. But you could use a FOR loop:
Starter tutorial: http://www.ni.com/gettingstarted/labviewbasics/
11-01-2012 04:37 AM
Hi Atamsih
You can also refer to an excellent article written about QSM @ http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/
11-01-2012 04:41 AM
if you want to save the array of enums to a text file, use one of the steps in the posted code
11-01-2012 04:45 AM
Arhh sigh, should have thought of the for loop. Well thanks for reminding me, i will accept your solution and give kudos.
Thank you,
Kind regards
Mathias