08-16-2016 01:32 AM
Hi,
I have written a program which commands a current supplier to raise the current from 0 to 50 A, during 1000 iteration. This current goes through a coil and forms a variable magnetic field. A gaussmeter is provided to measure the field. My aim is to record the field for each iteration. I have added the gaussmeter program in initial for loop so that I can read field corresponding to each momentary current. My problem is how to extract an array containing 1000 recorded fields from the loop and save it. I really appreciate it if you guide me.
Many thanks,
Hadi
Solved! Go to Solution.
08-16-2016 01:34 AM
share the code which you tried.
08-16-2016 01:36 AM
Hi Hadi,
use autoindexing tunnels to get your array with 1000 measurement values!
It's a very basic LabVIEW feature so I want to recommend you to go through the free online resources provided by NI.com to learn LabVIEW! 😉
08-16-2016 01:48 AM
Hello!
I'm not pretty sure I have understood you correctly but I have prepared some 'overview' piece of code. Maybe you can extract something from it 🙂
If you still have problems, please share the code.
Marcin
08-16-2016 02:09 AM
Dear Marcin I'm really grateful for your valuable response. I attached my code. It is a flat sequence structure includin 5 frames. In frames 1, 3, and 5 I've added a programe to read the field. I need a file containing 1000 values of recorded fields.
Bests,
08-16-2016 02:38 AM - edited 08-16-2016 02:51 AM
Hello!
As I understand from your code you get the values as a strings? (substring, substring 2 and substring 3)
In my opinion the best way to do it without refactoring the code is to create a queue with string as datatype. See the attachements (VI Snippet and VI contains exactly the same code but I have saved VI for the LabVIEW 8.6 version).
For the future projects, consider using State Machine http://www.ni.com/tutorial/7595/en/ Stacked (or flat) Sequence Structures are really diffucult to understand for other people than developer.
It is also always easier to share the code using VI Snippets http://www.ni.com/tutorial/9330/en/
Please, let me know whether it has helped you 🙂
08-16-2016 03:24 AM
many many thanks. your tips are quite helpfule and precious.
08-16-2016 03:55 AM
Hi hadi,
I need a file containing 1000 values of recorded fields.
Then why don't you save the string(s) one after the other into a file? No need to build arrays first…
Atleast it would have been the first and simplest method to store your data!
Beside this:
Learn LabVIEW. THINK DATAFLOW!
Reduce the usage of sequences…