Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

visa serial read and usb 6008 read simultaneously

Have anyone tried using visa serial read and a ni-usb 6008 daq device to read simutaneously? Can this be done?

0 Kudos
Message 1 of 22
(3,965 Views)

Yes, it can be done. Two different hardware interfaces.

 

What is your specific issue?

0 Kudos
Message 2 of 22
(3,960 Views)

Well, what I eventually want to do is to read and save some binary data using VISA. Because I am experiencing that through VISA, it only reads data as STRING ( is it true?). When there is too much data to be read, the system (PC) crashes. This leads to the motivation to find different ways to tackle this problem (By transferring binary data?). Maybe you can help me?

0 Kudos
Message 3 of 22
(3,948 Views)

VISA is meant to communicate via busses. This can be via strings or in binary. When the results arrive in the computer you have to convert this into meaningful data for you. This can be e.g. a series of time and amplitude values stored in an array. The same applies for the 6008 gathered data but most probable not at exact the same times, and I presume with a much greater number of samples.

So what do you want. Storing these data is step 3. First step is gathering the data and you forget the intermediate step of transforming raw data into meaningful data.

greetings from the Netherlands
0 Kudos
Message 4 of 22
(3,944 Views)

So are you saying that if I send in some binary, by using VISA Read Function, I will be reading the same binary data? 

0 Kudos
Message 5 of 22
(3,938 Views)

VISA does not care about binary or any other format. It is transferring bytes.

The question is what and how are you storing data in your pc.

If you store more data than you have memory, you get an errormessage and the program stops.

So what are you communicating from which instrument or system to your system.

too much is too much binary or not binary

greetings from the Netherlands
0 Kudos
Message 6 of 22
(3,935 Views)

I need some help for implementing Serial Read using VISA. I have the following scenario:

 

The data is transferred with structure as -

 

1st byte is ASCII "D"

2nd byte is ASCII "x"

3rd - 6th byte is a binary number for Channel one

7th - 10th byte is a binary number for Channel two

11th&12th byte is a binary number for Channel three

13th&14th byte is a binary number for Channel four

15th&16th byte is a binary number for Channel five

17th&18th byte is a binary number for Channel six

19th&20th byte is a binary number for Channel seven

 

From the above 1st byte to 20th byte, it goes on and repeats itself with all data transferred with MSB first.

 

Would anyone give me some advices for implementing this using VISA serial read?

0 Kudos
Message 7 of 22
(3,920 Views)

Okay

now you give some serious information.

 

The visa returns a string and part of that string is your information.

So first find the start, with match pattern. Find the first occurence of "Dx"

The next 18 bytes is your info. split them from the original string with substring and if you have some extra characters keep them for the next round.

 

These 18 bytes are splitted again into two 4 byte values and 5 two byte values.

Are these integers or doubles and play around in translating them, probably in a subvi to make playing with the values easier.

 

good luck.

greetings from the Netherlands
0 Kudos
Message 8 of 22
(3,916 Views)

Thanks for your promt reply. Please excuse me. I am a bit confused here already. Now i am sending data as binary (byte). I don't understand why we are operating in terms of 'string'?

0 Kudos
Message 9 of 22
(3,915 Views)

no problem.

A string and an array of bytes are the same in LabVIEW, you can "convert" them into each other and this conversion is awfully fast because it only tells the compiler to look in a different way at the memorylocations.

 

And not unimportant. VISA delivers a string to LabVIEW and you can use the string function to find Dx.

After that you can easily convert the 18 bytes in an array of bytes and use the join numbers function to build your values.

 

 

greetings from the Netherlands
0 Kudos
Message 10 of 22
(3,911 Views)