LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Conversion

Solved!
Go to solution

Hello all,

 

Help needed to solve the issue. Here i attached a vi for your reference.

0 Kudos
Message 1 of 10
(3,525 Views)

Yes, number to hexadecimal string

Yes.png

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 2 of 10
(3,524 Views)

@Even Deejay wrote:

Yes, number to hexadecimal string


No, that will not work:

 

  • The correct result needs some discontinuities
  • The output string is in hex display
0 Kudos
Message 3 of 10
(3,516 Views)

Dear Even. The actual problem with me right now is u can see from the image,

 

 

 

2.PNG

0 Kudos
Message 4 of 10
(3,514 Views)
Solution
Accepted by topic author Stephen.J

Here is equivalent code that does not use any case structures. I am not sure if it is any simpler. (LabVIEW 8.6)

 

 

For a better solution, we need to know what the range of possible input values is, because all you get out is a single useful byte (first byte is always zero). Most likely the code could be further simplified once we have more details on the problem. My currently attached solution gives identical output as your code for all possible I32 inputs (not fully tested).

 

 

Download All
Message 5 of 10
(3,496 Views)

Dear altenbach,

 

Thanks for u r reply. the range of input is between 0 - 29 only. The output is communicated with PLC using RS-232 C. the problem which have right now is, if sent the actual input its get changed as ASCII while communicating. I dont have a right person to convert the ascii into required value on the PLC hand.

0 Kudos
Message 6 of 10
(3,484 Views)

Hello ,

 

I am posting the equivalent diagram.

 

Try.PNG

 

 

 

 

 

 

 

 

 

 

 

Regards,

 

Bijay

0 Kudos
Message 7 of 10
(3,473 Views)

@Stephen.J wrote:

the problem which have right now is, if sent the actual input its get changed as ASCII while communicating. I dont have a right person to convert the ascii into required value on the PLC hand.


That makes little sense: Who changes what into what? Can you elaborate? Usually conversions are done by a computer, not by a person.

0 Kudos
Message 8 of 10
(3,456 Views)

Try this:

 

Hex String Literal.png

0 Kudos
Message 9 of 10
(3,449 Views)

@Stephen.J wrote:

Thanks for u r reply. the range of input is between 0 - 29 only.


I this case make sure the input is 16 bits. now the code is slightly simpler (you might need to ensure that the input is not out of range)

 

 

 

Download All
0 Kudos
Message 10 of 10
(3,437 Views)