12-28-2016 12:33 AM
Hello every one...
iam unable to fing one logic i.e i have an instrument which providing rs 485 data so iam able to read in labview but iam going to keep instrument on for long time so labview saving many samples in excel.my requirement is to save as per my specific sampling rate is it possible plese help me
Solved! Go to Solution.
12-28-2016 12:40 AM
can you insert vi for clear understanding?
12-28-2016 12:52 AM
This is the vi it is providing 2 to 3 samples in a second..but i need specific time ex: 20 sec 1 sample has to store
12-28-2016 01:27 AM
Hi hanumeshbujji,
when you want to save a sample each 20s you should program it that way!
Use the ElapsedTime ExpressVI, it will give you a boolean signal for saving samples in a case structure!
On your VI:
- Why is the BD so big? Why don't you use the AutoCleanupTool - it reduces your BD from 1688×503 down to 872×365 pixel!
- Why do you need to open and close the serial port in each iteration?
- Why do you use BytesAtPort? In combination with a TermChar???
- Why do you use BytesAtPort directly after the SerialWrite function? This is plain wrong!
- Why do you use a sequence structure? All is managed by DATAFLOW!
- Why has your path control NO label? Would you do programming in text-based languages without giving variables a meaningful name?
- Why do you write the header row with each sample? Usually you have just one header row with several rows of samples in spreadsheet files…
- There is no error handling in your VI: what happens when communication with your device fails?
12-28-2016 01:45 AM
Thank u sir...iam just testing the vi so i didn,t make it properly..anyway thank u so much sir.
12-28-2016 01:42 PM - edited 12-28-2016 01:43 PM
Hi hanumeshbujji,
Here i have done small modification as GerdW said, for saving a sample for every 20 sec. But I did not do any thing to reduce a sample rate to 1.
Hope it helps 😉
12-29-2016 01:10 AM - edited 12-29-2016 01:15 AM
12-29-2016 03:07 AM
Hi,
one more correction to my image above:
You need to move the first WriteSpreadsheet function (the one writing the header row) out of the loop - OR (atleast) set it to "append" mode too. Else you would overwrite your spreadsheet file again and again…