07-13-2022 09:21 AM
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
07-13-2022 11:14 AM - edited 07-13-2022 11:16 AM
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.
07-18-2022 02:46 AM
Hello Jorgemondadori,
Thanks fore your response; Actually the serial console is not enabled in the RPi configuration.
I've attached the code.
Thanks
07-18-2022 02:04 PM - edited 07-18-2022 02:08 PM
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?
07-20-2022 03:06 AM
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
07-20-2022 04:44 AM
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.
07-20-2022 05:43 AM
Thanks for the suggestion. I will try to use VISA API 🙂
04-18-2024 06:42 PM
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
05-15-2024 06:00 AM
so, do you mean the whole process supposed to be in only one loop?