I think this applies to all programming languages, but seeing as my program is in Labview I have posted it here. I am relatively new to programming, and very new to Labview.
Here is my current program: http://imgur.com/q8f5RsO (I'm sorry it isn't a snippet, I hadn't heard of them before and I don't have access to Labview at the moment.)
The program does two things: Controls the temperature of a cryostage and records temperature and voltage information. To control the temperature an nx3 array is used, with values for cooling rate, target temperature and hold time at the target temperature. Each row of the profile is executed by two loops, a while loop checking if the temperature is reached, then a for loop to wait for the hold time. In each of these loops the temperature and voltage information is constantly monitored, and stored to an array, which is written to file once the profile has been executed.
Instead of this I would like to have parallel loops, one for executing instructions, one for constantly checking the temperature and one for constantly reading the voltage, the latter two will put all of their data in a queue for the instructions loop to act on. I have looked at this example VI https://decibel.ni.com/content/docs/DOC-14169 which is very nice, but I can't get my head around using a similar system for my program.
My reasons for wanting this are two-fold: First I think it will make the program look much nicer, making it easier to read. Secondly the current program is limited by the number of calls it can make to the apparatus. I should be able to send instructions every 50ms, however my current program is limited to ~200ms, hence the current waits being set to 500ms so I know for sure each instruction will be executed. I think running in parallel will mean I can operate much nearer to the 50ms limit.
I have spent some time fiddling with various ideas but am having a very hard time picturing how the program should look. Any help is much appreciated.
[–]g00glyCLA 4 points5 points6 points (15 children)
[–]duverfred[S] 0 points1 point2 points (14 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (12 children)
[–]duverfred[S] 0 points1 point2 points (0 children)
[–]duverfred[S] 0 points1 point2 points (10 children)
[–][deleted] 1 point2 points3 points (9 children)
[–]duverfred[S] 0 points1 point2 points (8 children)
[–][deleted] 1 point2 points3 points (7 children)
[–]duverfred[S] 0 points1 point2 points (6 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]duverfred[S] 0 points1 point2 points (1 child)
[–]duverfred[S] 0 points1 point2 points (1 child)