04-04-2017 06:11 AM
The idea of the programm is this, i do not know how to interact with arduino
04-04-2017 06:26 AM - edited 04-04-2017 06:28 AM
1. Make your life a little easier and just have the knob go from 0 to 5. That avoids this whole 12-bit mess.
2. Use a Format Into String to build up a string with an End Of Line at the end. You can then just send this string to the Arduino. The Aruino then just has to read a line from the serial port and it has the value.
NOTE: I am just showing how to format the string and use VISA Write. You still need to put this inside of a loop, setup the serial port, and close the serial port when done.
04-04-2017 09:18 AM - edited 04-04-2017 09:23 AM
Judging by the PM you sent me, you don't know how to program an Arduino. Well this is not really an Arduino support forum but in a nutshell you just need the Arduino to send its raw analog value over the serial port to that LabVIEW program you wrote, or you can do the math in the Arduino and have it send the actual voltage value.
Using Arduino Analog Input
https://www.arduino.cc/en/Tutorial/AnalogInput
Using Arduino serial
https://www.arduino.cc/en/reference/serial
Now if you don't want to learn the Arduino programming language I suggest you look at LINX. (LabVIEW for Arduino).
https://www.labviewmakerhub.com/doku.php?id=libraries:linx:start
04-04-2017 10:19 AM
@lucabasile wrote:
the output must be a numeric indicator, if i understand what you mean
No, it is not clear at all!
An indicator displays a received numeric value, while a control lets the operator set a numeric value. In your first post, you talk about "... i have to do a serial-integer transmission ..." but you never told us the direction.
From the sentence above, it seem like you want to transmit the value from the Arduino to the LabVIEW program (and show it in an indicator), but from other posts, it seems that you want to transmit from the LabVIEW program to the Arduino (and set it with a control). These are two completely different problems, so which one is it?
There are millions of ways to transmit 12 bit and all you need to do is ensure that the two sides agree on the communication format. You have not shown us any hints what that would be.
Our answers typically cannot be better that the question, so the first thing that needs to be done is increase the quality of your question. Show us your entire code! Tell us what toolkit you are using! What is running on the Arduino? How is the hardware connected? What happens with the 12 bits?
04-04-2017 12:55 PM
i know you are right but im not pratical with this.. however i have to transmit from the labview to the arduino
04-04-2017 01:08 PM
@lucabasile wrote:
i know you are right but im not pratical with this.. however i have to transmit from the labview to the arduino
Have you even considered LINX?
https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:libraries:linx:start
The "Sparkfun Inventors Kit" Is just an Arduino clone.
https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:libraries:linx:sparkfun_inventors_kit
Here is a tutorial that leads you through using the Arduino analog input and LabVIEW