10-31-2018 07:44 AM
You said earlier that the C Code works fine. The if statement calls dht.readTemperature() to read the temperature. Can you provide the source code for that function to see what it does and to see if it does anything unusual?
10-31-2018 07:45 AM - edited 10-31-2018 07:45 AM
10-31-2018 07:59 AM
@jamiva wrote:
You said earlier that the C Code works fine. The if statement calls dht.readTemperature() to read the temperature. Can you provide the source code for that function to see what it does and to see if it does anything unusual?
The reason I asked is that you have no termination character on the VISA Write. Is your device expecting one?
10-31-2018 08:41 AM
I dont know if the problem is with the C code. Because when i get part of this code (for example, if i run only the DHT 22 sensor (humidity and temperature) code and it's VI, it's work fine).
It looks like the 'problem' starts to happen when i insert all the sensor's programing (DHT22, MQ2 and MQ135) in a single VI and a single C program.
I tried to run the program in parts... I created a new VI only for the DHT22 sensor and i created a new C code only for it. And it worked marvelus.
I did the same with MQ2 and MQ135 and it also worked.
that is why i think the problem might be in the code and not in the VI.
I rewrited the code but i could not see any issue.
10-31-2018 08:44 AM
i shoul receive the strings for the humidity, temperature, and the gases level.
but it happens sometimes.
The problem is, i dont receive any error..
I did not think on debugging.
10-31-2018 08:46 AM
yes, the source code is attached.
i dont think my device is expecting someting, because it only shows informations about the sensors in a VI.
10-31-2018 09:10 AM
hey, do you know what is funny?
When i start the application, it works, but for a few seconds.
did you even seen something like this?
Ps: I uploaded a video showing the issue
10-31-2018 09:35 AM
Hi marmaduke,
no, that's not funny.
That's exprected as soon as there is a communication problem!
From what I see in the video:
The first iteration with all 4 requests is successful.
Then the next iteration starts, the first request (temperature) is also successful. Then there are some delay due to timeouts of the VISARead (?) with the last 3 values not read.
Then the 3rd iteration starts, failing to read all values - still VISA problems.
Again:
Did you debug your VI?
Are there any VISA errors? In case "yes": which ones?
10-31-2018 12:01 PM
Did you debug your VI?
Sorry i'm still looking to find out how to debug my VI. I still dont know how to do it.
Are there any VISA errors? In case "yes": which ones?
I did not receive any erros. If i had receive any error, this arrow would be broken, right?
10-31-2018 12:08 PM
Hi marmaduke,
Sorry i'm still looking to find out how to debug my VI. I still dont know how to do it.
Then you should read the LabVIEW help on the topic "debugging"!
I did not receive any erros. If i had receive any error, this arrow would be broken, right?
Wrong!
The arrow would be broken when your VI is not runnable, but you can still get errors at runtime. You need to check them!
What about an indicator for the error wire?
What about debugging using probes or (conditional) breakpoints?