LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keep getting error 66 tcp read, is it because of bytes to read?

Solved!
Go to solution
Solution
Accepted by topic author David99999

@David99999 wrote:

And no, I did that manually in my post to make it easier to read. Here is what it looks like when I copy and paste directly from the string indicator:

 

{"Max Amps":1.1405940000000042113e-06,"Discharged Whs":0,"Charged Whs":0,"Avg Discharge Amps":1.2718751156039192901e-07,"Discharged Total Watts":0,"Charged Total Watts":0,"Battery Voltage":62}\r\n


The display style is set to normal.  So you are actually sending a literal "\r\n".  On your constant where you are adding the end of line, right-click and choose Visible Items->Display Style.  You will see a little 'n' appear on the left side of the constant.  Click that and choose '\ codes'.  Your string will now show "\\r\\n".  Remove the extra '\'s in there to make it "\r\n" and you will now have the proper Carriage Return and Line Feed.

 

Once you fix that, you will not need to remove the end of line on the receive end as the Unflatten From JSON will work with it.  But if you really want to, just use the Trim Whitespace function to remove it.

 

You might also want to bump up the number of characters to read to something like 500 since you are sending somewhat close to 250 characters already (194) and any change to the cluster could bump that count up quite a bit (25 for a floating point value).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 12
(410 Views)

YESSSSS. I could kiss you right now. It's a good thing you chimed in because I started going down another rabbit hole with the bytes to read terminals.

 

Thank you! I most definitely never would have figured that out.

0 Kudos
Message 12 of 12
(405 Views)