I am very new to this program and I need help urgently. I need to edit this script so that the LC100 line camera will scan and save 20 pictures, pause for say 20s and repeat the task. It will be helpful if notes are added. Thanks.
Solved! Go to Solution.
You did not specify how you want to save the data, so I just assumed a text file is ok. The sample.vi included is a good start. I just edited it so that the "start scan" and "get data" VIs run in a "for loop". A for loop works just like in other languages where it will run N times. Since you want it to run N times, then pause, then continue indefinitely, I have wrapped it in a while loop.
In order to make the VI easy to stop or run code periodically (on timeout), I have added in an event structure. Event structures are a little more advanced, but this one only has two events so it should not be too difficult.
I have left many comments for you to follow so you can get the VI working. Try to make sure you understand what every function does.
This is how far I have come. I have followed your instructions and have wired most, but I am still having a few errors. If I want to save the scan data as a text file does it simplify the vi? One more thing; with this vi do I need to change the operating/trigger mode? I am asking because with the sample vi, I was always getting errors when I changed the trigger mode from the SW (software trigger) to HW (hardware trigger) modes.
I just picked a text file, but you can pick other formats. What you have is an array integers, not strictly an "image". You can form it into a picture and save it as a .png if you like, but this is more complicated and it really depends what you want to use the data for later on. If you are going to graph it using LabVIEW or something, then a .txt file (or .csv file) should be fine.
I'm sorry, I am not familiar with your instrument or setup, but I would assume since there is a "start scan" VI in your software that you would want to use a software trigger.
Your upload was in LV 2017 so I cannot view it, I only have LV 2016. To save for previous versions you can click file >> save for previous version...
Sorry for the late response. I want the data as a txt because I am going to graph and compare them. This is the latest version.
Ok, you're getting there. Make sure to wire your "Data" into the "Array to Spreadsheet String". That will take your numeric data and convert it to a string appropriate for writing to a file. Also make sure to wire the selected folder path into the "Base Path" input of "Build Path". It's always good to wire the error wires through functions with error terminals, like the "Write File" vi.
Next, look at event , which triggers when you press stop. You'll need to wire the True constant out to the condition terminal of the while loop. This will stop the while loop, when you press "stop". Though if it's currently taking images you will have to wait until it's done.
I think I did all what you suggested. I am, however still having errors. Please check for me. Thanks
When you say errors, do you mean run-time errors or you have a broken run arrow? Please examine them and post what those errors are (screenshots). I see a couple stray wires I can help with after lunch.