Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LINX I2C and UART at the same time in LabVIEW

Hello Everyone, 

 

I'm trying to use the I2C and UART interface at same time. It worked the first time i launched the programm but then the target "Raspberry " disconnect. 

Now, i'm receiving an "unknown error" in the "Get Availabe Bytes" UART bloc.

 

Did someona ever try to do the same ? 

 

bellow the screenshot of the program, in which i'm trying in the first while loop to mesure the temperature and the humidiy with an I2C sensor, and the second Bloc is a state machine to send "AT Commands " to a Modem connected to the Raspberry, through UART.

 

Any help is greatly appreciated.

 

Thanks

 

Mimilem_0-1657719423892.png

 

0 Kudos
Message 1 of 9
(2,430 Views)

Hey Mimilem

we can't do much with a picture, but if you provide your application code it might help.

 

Let me ask you something:

Have you tried using the "find resources" subVI from the visa pallet to check if Serial is available? if not, try it to check if UART is available.

if it is not available i recommend you  to disable the serial console in your RPi configuration, because if it is enabled, then your console is holding this resource.

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 2 of 9
(2,408 Views)

Hello  Jorgemondadori, 

 

Thanks fore your response; Actually the serial console is not enabled in the RPi configuration.

 

I've attached the code.

 

Thanks 

0 Kudos
Message 3 of 9
(2,357 Views)

were you able to detect ASRL1::INSTR ?

 

are you connecting through GPIO 8 and 10?

Can you try using a USB TTL adapter?

i tried using differente hardware (a pzem module) on UART and i can send and receive requests while using I2C.

double check if serial is enabled and console serial disabled in your raspberry pi config.


Edit:

 

i noticed you are using channel 0, try using channel 1.
in my test i used visa API and VIs, not the ones from makerhub/LINX. Can you try using VISA directly?

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 4 of 9
(2,328 Views)

Hello, 

 

Yes the ASRL1::INSTR is working and i'm connecting through GPIO 8 and 10.

The serial is enabled and console serial disabled in the raspberry pi config.

I've tried using the channel 1 but it didn't work as well 😕

I can't use VISA Directly, cause i need the LINX Toolkit to deploy and run  LabVIEW on Raspberry Pi.

 

Thanks again

 

 

0 Kudos
Message 5 of 9
(2,305 Views)

In fact you dont have to use only linx/makerhub. You can use any compatible API. The makerhub toolkit probably encapsulates the visa api to make it simpler to use.

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 6 of 9
(2,300 Views)

Thanks for the suggestion. I will try to use VISA API 🙂 

 

 

0 Kudos
Message 7 of 9
(2,294 Views)

actually a see your vi because i ned to read a uart on arduino to read data from a camera

your problem is your are trying to proces in parallel you have to  operate i2c and later operate uart or uart first and later i2c and put all diagram in a loop

actualy i use very much flat secuence to cordinate  the data read and write 

sorry my engles is not good

0 Kudos
Message 8 of 9
(933 Views)

so, do you mean the whole process supposed to be in only one loop?

0 Kudos
Message 9 of 9
(789 Views)