07-13-2017 08:17 AM - edited 07-13-2017 08:27 AM
Thanks Paolo.
07-13-2017 08:26 AM
Hi GerdW.
From what Paolo mentioned it should be possible to use a property node to reformat the way the file path is sent before it is opened?
When right clicking the write buffer it doesn't offer Property/Invoke Nodes.
The only successful result is achieved as I previously mentioned whereby the string file constant is connected using Hex Format: 0430 3030 3002 4141 3E30 030D
When placing the exact same Hex Format in a text file it is now being read 3034 3330 2033 3033 3032 2034 3134 3120 3345 3330 2030 3330 44 which appears in Hex Format under the text indicator in the front panel. So in that case I'm trying to compare apples to apples. But clearly the apples I'm creating are becoming oranges once the file is opened.
Therefore the desired response from RS-232 is no longer achieved when being read through the text file.
I also attempted to convert the text file as suggested to no avail. - I tried to place Hex String To Number and then Byte Array To String in my code but they are causing breaks and not connecting.
I am trying to find a solution and will continue to try, I will make sure to post the solution if I get there before you do!
Many Thanks
07-13-2017 08:30 AM - edited 07-13-2017 08:32 AM
Hi neunited,
you need to use a string control/indicator to use that property node.
Or you follow crossrulz' suggestion:
Whatever is easier for you…
the string file constant is connected using Hex Format: 0430 3030 3002 4141 3E30 030D
When placing the exact same Hex Format in a text file it is now being read 3034 3330 2033 3033 3032 2034 3134 3120 3345 3330 2030 3330 44 which appears in Hex Format
That's the point I made before: you need to use the very same display format in all places - even in your text editor!
07-13-2017 09:59 AM
Hi GerdW,
The example you provided has worked (the working VI has been attached for reference). Thank you for your example.
I simply inserted GerdW suggestion (placed into a subVI) and the Hex values were read and provide the correct Hex response of 06. Also keep in mind that the text file should be saved as Encoding: Ansii
So now that this has been accomplished I need to create the reverse process in order to write the Hex response of 06 into a new text file, as shown in the response tab.
Would appreciate any further advice
Many Thanks
07-13-2017 10:20 AM
String To Byte Array
Number To Hexidecimal String (make sure the width is set to 2, this function will work with the array of bytes)
Concatenate String (combine the resulting string array into a single string)
Write To Text File
07-19-2017 09:41 AM
Hello again,
I would like to note that GerdW illustration does work. But please note if you wish to send a "Write" as a control with the Hexadecimal command, it needs to be set to Normal Display mode rather than Hex Display. The Read indicator remains as Hex display.
Not sure if there is any logical reasoning for this approach but this is the workaround for LabVIEW 2017 .
Many thanks
07-19-2017 09:51 AM
Hi neunited,
GerdW illustration does work
Sure it works as intended: convert a string in normal display, holding hexadecimal numbers, into a string consisting of the byte values corresponding to those hexadecimal numbers…
That's what you asked for!
this approach but this is the workaround
It's not a "workaround"! It's a simple conversion as per your requirements!
There were also other solutions shown, but when mine is ok for then it's ok for me too! 😄