09-23-2019 11:47 AM
excuse , hello i am from indonesia
my program using arduino, i collect the data to get standard deviation , so i think i use an array , but im confuse with last 2 slot that always contain last measurement or zero if it never measure before , ty before
Solved! Go to Solution.
09-23-2019 12:07 PM
Time to bring this up again
DON'T USE BYTES AT PORT!
Do you know you got a complete message? What is the format that your Arduino sends the data?
A proper communication protocol will send a complete message and end it with a termination character that tells the end of the message has been reached. Your Serial Configure is already set up by default to expect a termination character of a line feed character.
If your message is incomplete, then when it parses the data, you'll get an error or nothing with will be interpreted as a zero.
09-24-2019 08:35 AM
thanks for replying
if i not use bytes at port , im trying not to use it then the program dont run ,
my arduino send string data then i parcing it to get 4 input data analog from potensio resistor
mr ravens can you give me a program or refrence for my program , ty for the advice
09-24-2019 09:36 AM
@kucink wrote:
thanks for replying
if i not use bytes at port , im trying not to use it then the program dont run ,
my arduino send string data then i parcing it to get 4 input data analog from potensio resistor
mr ravens can you give me a program or refrence for my program , ty for the advice
What do you mean by "dont run"? If you're using the println function, your Serial writes will end with a LF character. (e.g. if your code is "Serial.println(mydatavalue)" )
When you use the Match Pattern node you're splitting the string at each letter and then just ignoring parts of the string (because for example, the output at the B node will be "1023.00C1023.00D1023.00"
Consider using something like Scan From String Function instead (or Match Regular Expression with subpatterns).
Here's an example that removes the Bytes at Port:
Read a large number for the "VISA Read" to ensure the reason for a complete read is a complete line (not fixed number of characters).
09-24-2019 10:46 AM
thank you so much
the program running by changing visa flush io with visa set io and delete property node
thanks i will read more and ask more
thanks mr ravens