LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I would like to store my rs232 data into a excel file and graph it using cvi.

I can write to my measurement instrument, but I am having trouble collecting data from this instrument that has a rs232 input. I write BAcr to tell my instrument to send data. I would like to collect this data in a excel chart then graph it. Would anybody have a example program besides the ones published by ni.
0 Kudos
Message 1 of 20
(4,039 Views)
Hi Mark,
Does you instrument return the data? (i.e. if you run in Debug mode, and put a breakpoint after you've received it, is the array you collect the data into full?) Which part do you need a help with - the graphing of the acquired data, or the collection of the data or both? Do you want to put the data directly into Excel (i.e. open it and have the data filled in), or would saving to a .csv file which you can then open later be OK?
If I know this, and a few other things, I'll put together an example for you. What version of CVI are you using?

Thanks

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 20
(4,039 Views)
I need help with the graphing and acquiring the data. I can write data fine to my instrument. I am having trouble collecting data and storing it. I would like to save the information in a .csv file which can be opened later. I am using cvi 5.01. To request data from my instrument is BAcr and the format that the data my instrument puts out is NA------CR where ------ is my data followed with a CR. I would appreciate it if you can help me out with this problem. I tried to use the examples that NI provides but they did not work. Thanks Mark
0 Kudos
Message 3 of 20
(4,039 Views)
Hi Mark,
can you attach a snippet of the data - I'm assuming that if you can see the data itself, then you are able to get it back to CVI ok, and all you need to do is the graphing? What do you mean by collecting data - are you having a problem with the comms that stops CVI seeing the information? Have you tried (if it's a GPIB link) ibic, or the communicate with instrument section in MAX? Are you using serial comms or GPIB? What's the instrument - do you have a driver or are you sending the request for data command raw?

Once I've got a snapshot of the raw data, I can give an example of how to split it up and graph it.
You haven't said whether the data is comma separated, tab deliminated etc, and what format the data is in - floating point, engi
neering, integers etc.

Thanks

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 20
(4,039 Views)
Hi Mark,
sorry for the silly question above on the interface - you're using RS232 - should have re-read the first section first...

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 5 of 20
(4,039 Views)
I am using serial communication to collect my data, and I am sending raw data to request data from my instrument.I am unable to see any data that my instrument is providing. I attached some of my code so you can understand what I am talking about. I haven't cleaned it up yet and it has a lot of callbacks and functions and other code that I'm not interested in using yet or ever. The part of my code that isn't working right now is the collect data where I send my data followed by a cr. What I would like to do is once this button is pushed the callback function will collect my data for me and store it in a csv format where I can then use it to graph and maybe have that data display in a string or some other way. I currently ha
ve a lot of garbage with the excel in my program, I was just trying something, but I would like to get rid of that part of the program and just store it in a csv format. I am able to use the peak and unit callbacks that I have and I know they are sending data to my instrument. Thanks for you time with helping me with this problem. Mark
Download All
0 Kudos
Message 6 of 20
(4,039 Views)
Hi Mark,
here's some simple files to make up a project. It's a starting point that I need you to check if it works. I send out the BA with the carriage return, and then use a callback to see if there's any data coming back from the serial port (anything over three bytes should show up in the text box).
If the data comes back, post it back here, and we'll see about splitting it up into graphable data, and saving it to a .csv file.

S.
// it takes almost no time to rate an answer Smiley Wink
Download All
0 Kudos
Message 7 of 20
(4,039 Views)
I tried the sample program that you provided but it didn't work. Is there something that I might need to change with this starter program or is it missing something?
0 Kudos
Message 8 of 20
(4,039 Views)
Hi Mark,
in what way didn't it work -
a)did the serial data get transmitted to the instrument (BAcr)
b)did the program compile and run?
c)did the instrument display any remote connection?
d)did the instrument return no data?

We need to make sure we can talk to the instrument first - what instrument is it - is there a soft copy manual?

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 9 of 20
(4,039 Views)
Your program compiled file and ran but my instrument did not return any data into the textbox provided. I attached a manual of the instrument that I am working with. The RS232 properties are on page 4 of the manual.
0 Kudos
Message 10 of 20
(4,039 Views)