10-10-2018 10:33 AM
I would consider getting rid of the ASRL End Out node. Just include the \n in the string constant as well.
If you use the VISA Serial Config function, you can get rid of the VISA open and the entire property node since it is built into the Serial Configure.
Double check your data type for the 256 constant. You have a coercion dot there. Whenever creating constants or controls, you are best off just right clicking on the functions terminal and picking Create Constant. Then you'll get a constant of the correct datatype.
Show what your raw string is coming from the VISA Read. Make sure that shows what you want. I don't understand what you are trying to format the string into.
10-10-2018 10:53 AM - edited 10-10-2018 10:54 AM
@Demisicus wrote:
Many thanks RavensFan, it was that sneaky i32 causing the timeouts all along. I now nearly have the program working, my returned String appears to be empty (displays only \r\n). I will have to be far more careful with my types.
I've scraped my knee tripping over that one a long time ago. It's something you'll never forget. 😄 (But also something you might trip over from time to time, regardless. Umm... yeah.)
10-10-2018 10:59 AM
It looks like you wired the String indicator to "remaining string". That's why the response is \r\n. It should be connected to the "abc" terminal. Better yet use Trim Whitespace.vi
10-10-2018 11:16 AM
@RavensFan wrote:
I would consider getting rid of the ASRL End Out node. Just include the \n in the string constant as well.
If you use the VISA Serial Config function, you can get rid of the VISA open and the entire property node since it is built into the Serial Configure.
Double check your data type for the 256 constant. You have a coercion dot there. Whenever creating constants or controls, you are best off just right clicking on the functions terminal and picking Create Constant. Then you'll get a constant of the correct datatype.
Show what your raw string is coming from the VISA Read. Make sure that shows what you want. I don't understand what you are trying to format the string into.
To expand on this - and this is the reason I don't use the property - is because that is a serial bus only property, making your code work for only the serial bus. To make it "bus-agnostic", add the term chars to the end instead.
10-10-2018 11:59 AM
Brilliant, thanks very much to everyone - I've now got the vi to work perfectly! I'll add a comment on the article as a warning to future readers.
I look forward to learning more about labview!
10-10-2018 04:01 PM
@Demisicus wrote:
Many thanks RavensFan, it was that sneaky i32 causing the timeouts all along. I now nearly have the program working, my returned String appears to be empty (displays only \r\n). I will have to be far more careful with my types.
As well as that awesome advice on showing display format on string constants... show a label on constants and at least use the data type! Sweet catch Bill! The other Bill Mr. Ko
10-10-2018 04:03 PM - edited 10-10-2018 04:06 PM
@Demisicus wrote:
Many thanks RavensFan, it was that sneaky i32 causing the timeouts all along. I now nearly have the program working, my returned String koappears to be empty (displays only \r\n). I will have to be far more careful with my types.
It appears empty because.....
The new line returned hides the single line of non whitespace text displayed in the indicator:D
Oops, no you are getting the wrong string from the search.
10-10-2018 04:05 PM
Yes, a few daft mistakes but fortunately for me you guys have a lot of patience.
10-10-2018 04:07 PM
@Demisicus wrote:
Yes, a few daft mistakes but fortunately for me you guys have a lot of patience.
Trust me, sometimes it is entertainment