取消
显示结果 
搜索替代 
您的意思是: 

String Conversion

已解决!
转到解答

Hello all,

 

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

0 项奖励
1 条消息(共 10 条)
5,168 次查看

Yes, number to hexadecimal string

Yes.png

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 项奖励
2 条消息(共 10 条)
5,167 次查看

@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 项奖励
3 条消息(共 10 条)
5,159 次查看

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

 

 

 

2.PNG

0 项奖励
4 条消息(共 10 条)
5,157 次查看
解答
接受人 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).

 

 

下载全部
5 条消息(共 10 条)
5,139 次查看

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 项奖励
6 条消息(共 10 条)
5,127 次查看

Hello ,

 

I am posting the equivalent diagram.

 

Try.PNG

 

 

 

 

 

 

 

 

 

 

 

Regards,

 

Bijay

0 项奖励
7 条消息(共 10 条)
5,116 次查看

@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 项奖励
8 条消息(共 10 条)
5,099 次查看

Try this:

 

Hex String Literal.png

0 项奖励
9 条消息(共 10 条)
5,092 次查看

@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)

 

 

 

下载全部
0 项奖励
10 条消息(共 10 条)
5,080 次查看