06-28-2018 10:32 PM
may i ask you please edit my labview program in way that you think it is OK?
09-20-2018 04:06 PM
Hey man, you good? 😉
Could you help me to read a Gas Sensor (MQ2, or MQ7) using labview VISA?
I dont know much labview, i'm still learning...
I'm trying to read the sensor using labview visa, but i'm not being capable of it 😞
PLEASE, HELP ME?
09-20-2018 04:31 PM
There are a plethora of NI VISA help documents and examples on this website or the internet in general. By doing very simple google searches, you should find exactly what you need to help you. But because your post says nothing about what you've tried, we have to assume you tried nothing and very few people here are interested in helping those who won't help themselves. Especially for something like this that I and everyone else here knows could be solved by reading a few documents, you're going to find help in short supply. I only say this as a frustrated developer who sees way too many of these requests for help that are actually requests for someone to do their work for them. Read. Study. Learn. Forum help is meant to correct misunderstandings. It is meant for guidance. It is meant for collaboration and growth. This is not where you start at 0 and remain at 0 when you're done.
09-21-2018 06:34 AM
SORRY, it was not my intention to look lazy or wanting you to do it for me.
I'm just afraid of doing something wrong and burn the sensor.
I can run the gas sensor in Arduino IDE. Its working .. but i want to create some kind of interface in Labview.
The great problem is I dont know how to use the Arduino code in Labview. I MADE SOME RESEARCH and the people said first I need to create the code in C and later, create the interface in labview.
AGAIN ... I'm not asking for someone do it for me .. I DONT WANT THIS. I'm just lost, really.
I just dont know how to make arduino IDE work with Labview.
09-21-2018 07:33 AM
@KnissM wrote:
I just dont know how to make arduino IDE work with Labview.
You don't. They are completely separate. You develop code to run on the Arduino. Part of that development is an interface for sending data back and forth with something over the RS-232 connection. Then on the PC, you can use LabVIEW to interact with the Arduino using that serial interface protocol and make the GUI.
The simplest protocol for sending data from the Arduino is to use the Serial.PrintLn() command. This sends an ASCII string with a Carriage Return and a Line Feed appended to the end. Then on the LabVIEW side, you just make sure you configured VISA to used the termination character and set it to a Line Feed (0xA). Both of those settings are the default on the VISA Configure Serial Port. Then you just tell the VISA Read to read more bytes than you ever expect in a message. You can then convert the ASCII string into a number and do whatever you need with it.
09-21-2018 07:48 AM
Hmmmmmm, i think i got it.
I'm going to run some tests.
Thanks for now
09-21-2018 11:17 PM
I managed to make the sensor works on Arduino IDE. \o/ \o \o/
I can see the results in the serial monitor. =D
I tried to make it work on labview, but it did not work very well.:(
Actually when i run the .vi i do not receive any error...
Can you help me figure out where am I going wrong?
09-22-2018 12:50 AM
Reread Crossrulz's message 2 above yours. Instead of following that message, you decided to do the exact opposite!
You need to take advantage of the termination character. That means don't disable. Don't use Bytes at Port which is the wrong thing to use 99% of the time. Just read a large number of bytes. A number higher than the longest message you expect to receive.
Get rid of your case structure. It is pointless. You actually have a wiring error in your false case because you feed your VISA reference wire into the string conversion. Your VISA read and the conversion of that read to a number all belong in the while loop.
You also need to add a VISA close which belongs after the while loop you need to add.
09-22-2018 09:23 AM
i'm a little bit lost.
i changed the program, it's running, but it's not showing any data.
I also did not understand why the "ppm" is not returning any value, its asking, actually.
(ppm means parts per milion, its the way to measure the gas level. but i think you guys shuld know that).
I know there is something wrong. but i can not see the error.
09-22-2018 09:24 AM
maybe is there someting wrong with my code?