10-18-2018 08:43 AM
Having Major issues
First and foremost I am a total noob at LabVIEW im trying to get better!
secondly, I am having issues with the temperature only displaying incremental values as the PNG image shows, and other values displaying.
Thirdly, I want to send my microcontroller adjustable variables from LabVIEW which I can set from the LabVIEW interface. I require 5 controllable values on a scale of 0 - 255 of each can be sent to Arduino. here I can send them to the PWM ports once i read them in.
Please dont say use LIFA (i have already used LIFA it works great but does not offer me transportability so VISA is much more robust for my purposes.
please can offer me some advice and perhaps give me an example in my code of how i can output variables to my microcontroller.
im really stuck and need help
Thanks in advance!
10-18-2018 09:15 AM
Hi xx,
Please dont say use LIFA
Use LINX! 😄
I want to send my microcontroller adjustable variables from LabVIEW which I can set from the LabVIEW interface. I require 5 controllable values on a scale of 0 - 255 of each can be sent to Arduino. here I can send them to the PWM ports once i read them in.
Create a sketch for your Arduino.
Implement handling of the serial port.
Implement some commands (to receive data from your PC/LabVIEW) and implement some messages to answer those commands.
Then use VISA functions in LabVIEW to communicate with your Arduino!
10-18-2018 09:28 AM - edited 10-18-2018 09:31 AM
Well your LabVIEW version is newer than mine so I can't look at your code.
But...
Communicating with a microcontroller over a serial port using VISA is no different than communicating with an instrument connected to a serial port, in fact it is easier. Because you (I assume) are programming the microcontroller, so you get to decide how both the query and response should be formatted.
Since I can't give you any exact things to change in your code I will give some general hints.
10-19-2018 04:49 AM
So is this the correct way to send the information to the write file?
refer to PGN (Like this)
also still not sure how to fix my issue with the temperature only displaying every so often.
thanks in advance
10-19-2018 05:35 AM - edited 10-19-2018 05:48 AM
Hi xx,
is this the correct way to send the information to the write file?
Surely not - as you would have noticed once you start debugging your own code…
See the difference in your conversion and my suggestion:
They are different in complexity - and in the final string result (for a good reason)…
Btw. (auto-)cleaning up the block diagram would help to increase its readability!
On your "Still this issue" image:
- what is the content of the "read buffer"?
- why do you use an empty string as delimiter at SpreadsheetStringToArray?
- why do you convert to a 2D array when you apparently only receive a 1D array?
- why do you create a waveform with a dt of zero?
- why do you need formula nodes for simple calculations?
- why do you need a comparison and a select function instead of a simple MinMax function?