09-30-2021 08:07 AM
Hi guys, I am new in the NI community and i just started learning labview few weeks ago.
My project consists in two separate loop.
1) SEND LOOP. It is supposed to send from a labview interface to PSoC some strings in order to make a motor work. I have one loop (called 'send loop') with a case structure inside that take care of this request. This part of my project works properly.
2) RECEIVE LOOP. I want also to be able to read continuosly 2 bytes data sent by my PSoC to the same labview interface. I am trying to do this in the so called 'receive loop'.
The PSoC part where i create the 2 bytes data is this:
BL = count_1 & 0xFF;
BH = count_1 >> 8;
data[0]= BL;
data[1] = BH;
USBUART_1_PutData((uint8*)data, length_data);
where length_data=2, count_1 is an int16 variable and BL and BH are int8 variables.
I think that the PSoC part is correct.
Can someone help me to understand what is wrong in the receive loop? I think i am managing the VISA functions in the wrong way.
Thank you all!
09-30-2021 08:33 AM - edited 09-30-2021 08:50 AM
09-30-2021 09:14 AM
How often are the data being sent from the PSoC? How do you know you have the right 2 bytes in the correct order?
I have a lot of concerns with your messaging protocol, especially since I am seeing ASCII and raw/binary/hex data being used. You need to spend some time thinking through your messaging protocol. It would probably be best to use ASCII on all sides.
You might want to watch this presentation: VIWeek 2020/Proper way to communicate over serial