Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

UART communication LabView and STM32

how can write and read more than one information send by interface labview to stm32f4 board ?
my problem is how can multifois control a stm32f407 boards.
I use NI-VISA write and read to write and read information but I need to read 3 or 4 data each time write and read the result
I want answers and I'm ready for any explanation
you find a simple montage explains what I do

0 Kudos
Message 1 of 17
(5,350 Views)

Hello
first of all i wish you a good day and thank you for the explanation on the questions imposed.
my problem is how can multifois control a stm32f407 card.
I use NI-VISA write and read to write and read information but I need to read 3 or 4 data each time write and read the result
I want answers and I'm ready for any explanation
you find a simple montage explains what I do

0 Kudos
Message 2 of 17
(5,273 Views)

Do not use bytes at port, but use an endcharacter.

Tell VISA to read more bytes then you expect and it will stop at the specified end character e.g. a new line character.

 

Search for the C:\Program Files (x86)\National Instruments\LabVIEW 2018\examples\Instrument IO\Serial\Continuous Serial Write and Read.vi

Maybe it is in your installation in another folder.

greetings from the Netherlands
Message 3 of 17
(5,328 Views)

the proleme is that the visa read and write only the type string but the data is of numeric type, in this case I use the converter as indicated in the image attach question and it works well but when I want to read and write more only one data does not work.
do I need to do independent case structure and how ?
do you have an idea?

0 Kudos
Message 4 of 17
(5,326 Views)

Hello sir

I need help
I am using the stm32 card I would like to communicate with labview interface.
i used uart communication with adapator ttl usb
I can read and write a single data but I can not read more than
can you help me read and write more than one data
thank you in advance

0 Kudos
Message 5 of 17
(5,312 Views)

All variables in LabVIEW can be flattened to string and the bytes can be send by VISA.

But flattening to string is adding a typedescriptor so what you really need is the typecast of a variable to string.

That also is possible. So if you send what variable you want to transmit we can help you.

greetings from the Netherlands
Message 6 of 17
(5,299 Views)

@Albert.Geven wrote:

But flattening to string is adding a typedescriptor so what you really need is the typecast of a variable to string.


Nope.  The Flatten To String does NOT add any type descriptor unless you are flattening a variant (the descriptor is actually part of the variant data).  But if you flatten a single byte, the string will contain only that byte.  I actually prefer using Flatten To String and Unflatten From String because you can set the endianness of the string.  There is also the option with arrays and string whether or not to include the sizes of the array/string in the flattened string.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 17
(5,293 Views)

Crossrulz, you are right.

greetings from the Netherlands
Message 8 of 17
(5,283 Views)

thank you for your interaction with this question, to explain my problem: regarding the sending and receiving data, I use typecast to convert the veriable TO STRING is well resolved but the problem when I need more than one entry c ' is to say I sent and received 4 or 5 variable the question
how is it possible to read a single variable each time and display the result then go on to the second and even read and display until the 4 data ends?
is it preferable to use sequence structure or does the Write Visa and Read Visa 4 successive times?
I thank you again 

 

 

0 Kudos
Message 9 of 17
(5,273 Views)

Adding an endcharacter is not possible when writing and reading binary data, soyou need to use a fixed number of bytes.

You probably know exactly which data types in which order to expect. If not send the length or type of each transfer as a first byte.

Then read just one byte and after that the number of bytes identified in the first byte. 

greetings from the Netherlands
0 Kudos
Message 10 of 17
(5,267 Views)