Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sat Nov 18, 2017 10:23 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Send ASCII CHR
PostPosted: Thu May 04, 2006 10:28 am 
Offline

Joined: Mon May 01, 2006 3:27 pm
Posts: 60
In Visual basic I would use the following to send Data



Send=Chr$(RED(Fixture))



Below I have managed to get a 255 by sending "\xFF" but how would I convert RED(Fixture) . I tried to convert to Hex but it still does not give me ASCII chrs













func valueChanged()



Dim D as string







RED[Fixture]=spinner_r.value



D=_formatAsHex(RED[Fixture],2,false)



transmit(com1,"\xFF", false) ' THIS WORKS







endfunc


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 10:40 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
The code you are looking for is



Code:

func valueChanged()



    dim toTx[1] as byte

    RED[Fixture]=spinner_r.value



    toTx[0] := RED[Fixture]

    transmit(com1, toTx, false) ' THIS WORKS

 

endfunc





_FormatAsHex is intended to convert a numeric (integer) value to a string format containing the hexadecimal representation of that number, which is not what you want.



In Qlarity, strings and arrays of bytes can be used interchangably

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 10:47 am 
Offline

Joined: Mon May 01, 2006 3:27 pm
Posts: 60
:D



Very nice, That work fine.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group