LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA reading only bit by bit

Iam doing VISA serial reading and writing.In the attached VI reading happens only bit by bit.But I need the output as "9A42" itself as shown in the example.Please suggest a way to read entire bytes properly.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 1 of 6
(2,504 Views)

Hi!

It's not clear to me what you want to do with your vi.

Anyhow:

the string array control is out of the while loop, so its value is read only once, so basically the case structure will always execute the "false" case.

A couple of questions:

Do you need to use two different serial ports, as in your code?

Shouldn't you read *after* the writing? (in your code the two actions are executed in parallel)

Note that VISA Reading read entire bytes and not bits.

 

Regards,

Marco

 

0 Kudos
Message 2 of 6
(2,498 Views)

Can we convert a "string to string array"??

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 3 of 6
(2,496 Views)

"Note that VISA Reading read entire bytes and not bits."

But while running this VI we can see the output as:9 then after sometime 'A' then '4'......Iam trying to view the output as '9A42' itself.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 4 of 6
(2,492 Views)

In your vi you are reading 1 byte: you should change the constat your wired to the needed value (4?) and, as I said earlier, your should read *after* you wrote.

 

Regards,

Marco

0 Kudos
Message 5 of 6
(2,490 Views)

Hi Marco,

              By changing it to 4 we can read 9A42  but on the next iteartion 2976 is coming togather.I just need to read the data as per the index of the array is increasing.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 6 of 6
(2,482 Views)