LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication

Solved!
Go to solution
Dear Ray, thanks for ur reply. i learned about the VISA serial, but i am only facing 1 problem. I WANT TO SEND 2 BYTES ( each byte of 8 bits) to the pic , one byte to drive 1 servo motor, and the other to drive the second. HOW CAN I SEND 2 BYTES to the input of the visa write knowing that those bytes i have them ready as U8 ???? do i have to convert them to strings? and how can i let them both be input to the VISA WRITE
0 Kudos
Message 11 of 25
(1,092 Views)

 thanks for ur reply.

i learned about the VISA serial, but i am only facing 1 problem.

I WANT TO SEND 2 BYTES ( each byte of 8 bits) to the pic , one byte to drive 1 servo motor, and the other to drive the second.

HOW CAN I SEND 2 BYTES to the input of the visa write knowing that those bytes i have them ready as U8 ????

do i have to convert them to strings? and how can i let them both be input to the VISA WRITE

0 Kudos
Message 12 of 25
(1,092 Views)

Dear Ray, thanks for ur reply.

i learned about the VISA serial, but i am only facing 1 problem.

I WANT TO SEND 2 BYTES ( each byte of 8 bits) to the pic , one byte to drive 1 servo motor, and the other to drive the second.

HOW CAN I SEND 2 BYTES to the input of the visa write knowing that those bytes i have them ready as U8 ????

do i have to convert them to strings? and how can i let them both be input to the VISA WRITE???

There is a tool named ' format into string;' i think it can help me , but this will divide me the BYTE that i have into 3 characters .. and i dont want this, i want to send each byte as one character.. please help me if u can .thxx

0 Kudos
Message 13 of 25
(1,092 Views)

Have a little patience. No need to ask the same thing 4 times.

 

Here's a simple way with the Byte Array to String function. Having two separate VISA Writes would also work. Did you try anything at all? Format into string is not at all correct.

 

 

0 Kudos
Message 14 of 25
(1,087 Views)

can u explain me wut are u doing here please ?

i did something different .

i took the 8 bits , enter it to ' build array' and then BYTE ARRAY TO STRING . In this way i can transform the 8 bits to string right?

and then i used' CONCATENATE STRINGS' in order to send 2 STRINGS to the visa WRITE

CAN I DO THIS ???

0 Kudos
Message 15 of 25
(1,078 Views)

Yes, you can do that but why? Simpler to have an array with both bytes in it to start with like my example.

 

You can also have a single string constant. Right click on it and select 'Hex Display'. Type in as many bytes as you want and wire it directly to the input of the VISA Write.

 

p.s. And stop shouting! No need for the all caps.

0 Kudos
Message 16 of 25
(1,074 Views)

heheh .. i am not shouting i just write this way sorry lol.

The 2 bytes that i have are not constant, i have them as output after a signal processing algorithm.

those bytes should be converted to 2 strings before they are sent right?

i did not understand why are u multiplying the Bytes by 55 and AA ?? and another thing, i have 2 Bytes so isnt the Concatenate Stings necessary? since i have to send them both ? 

0 Kudos
Message 17 of 25
(1,056 Views)

There is absolutely no multiplication being performed. I simply have an array constant with byte values of 55 and AA. You can simply take your separate bytes, wire them to a single build array function and wire that to a single Byte Array to String. No, the concantanate string function is not necessary.

 

If you really think there was multiplication being done and don't recognize an array constant, you should stop everything and take some of the LabVIEW tutorials.

0 Kudos
Message 18 of 25
(1,053 Views)

okay, i think i got the idea , just one more question please. Did u say that i should wire each Byte to a build array? or i should wire both bytes to 1 Build array ( of 2 inputs) and then the output will be connected to the VISA WRITE? i will attach a part of my project to check it please. Thanks again for ur help , and u are right am not an expert in labview. i just have a limited time to finish this project and i really appreciate your help

0 Kudos
Message 19 of 25
(1,037 Views)
0 Kudos
Message 20 of 25
(1,036 Views)