look up in a JS reference number.toString(base) as in
n=17; hex="0x"+n.toString(16) yields the string "0x11"
Also look at my Serial Comm reference on my web site. I believe it illustrates your question with several answers
It also explains the bigger picture in that if you want to place an integer of value let's say 17 into a string there is no need to go to hex. JS on seeing a string of the form "\xnn" where nn is a hex number (00-FF) converts it to an integer (0-255) to place in the appropriate byte, the issue there is packing as numbers in memory hold two bytes (16 bits)
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/6L5jCd8tD6YJ.
To post to this group, send email to comman...@googlegroups.com.
To unsubscribe from this group, send email to
commandfusio...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/commandfusion?hl=en.
Hate to disagree, but IIRC string.fromCharCode assumes the argument is the ascii index for the character so it is a decimal 17 this would result in the byte being of type string with the decimal value of 17. "\x17" will produce the byte whose ascii index (decimal value) is 23
I spent a lot of time on the pronto forum trying to explain the difference between representations and the contents of a byte. The contents of a byte which is always a number in the range of 0-255 can be represented in many different bases and using several different notations, however when push comes to shove the byte will contain a number in the range of 0-255 decimal. Because HEX is such a convenient representation for things that come in sizes of 4 bits (0-15 decimal) many like hex. Ergo two hex bytes are a convenient and easily decoded way of representing 8 bit binary quantities.
When I started programming in the early 60's the machine I worked on had a 24 bit memory cell and 24 bit registers. We represented everything in octal which is similar to the utility of HEX with three bit quantities.
The bottom line however is just getting the memory to contain the correct numbers no matter how you choose to represent them, ASCII, HEX, Octal, decimal etc.
In Javascript the notation "\x21" and string.fromcharCode(33) and "!" are all the exact same quantity in memory. Just a different way of representing them on paper with JS doing the conversion
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/aHDAvQKuessJ.
To unsubscribe from this group, send email to commandfusion+unsubscribe@googlegroups.com.
That is exactly why I keep a 5 port linksys hub in my toolbox. yes they are still available. A google or yahoo search will find one
From:
comman...@googlegroups.com [mailto:comman...@googlegroups.com] On
Behalf Of JohanJ
Sent: Saturday, April 28, 2012 9:06 AM
To: comman...@googlegroups.com
Subject: Re: How to combine hex bytes from variables in javascript
Thanks, I know that a hub also would be sufficient but I do
not have that either. Can one still buy such a device? I do not see the point
with them, apart for sniffing packages.
To unsubscribe from this group, send email to commandfusio...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/caFh8KoFKTEJ.
To post to this group, send email to comman...@googlegroups.com.
To unsubscribe from this group, send email to commandfusio...@googlegroups.com.
Thanks for the code, I will try as soon I get a moment.
Is it not possible to use the learned IR code directly? I was hoping that I could just learn the needed codes with the pronto remote and then copy/paste them.
Johan
First of all, thanks for the code, i was waiting for somthing like this for a long time.
I tryed it to control my RFX9600. the relays work fine, but i have some trouble with
the infrared functions. When i send them with my TSU, the status light on the RFX
is flashing brightly, and the comand gets executet. but when i send it with the iPad,
the status light is flashing only short and weak, and there gets no command executed.
The only things i changed on your code is that i took out your CP. functions, and also
took out your special section for the air conditioner in the IR part.
I compared the messages with prontonic, and the ones from TSU are identivaly to the ones from the iPad.
i also allways get a timeout from the RFX when i execute the relay function, even when these are working fine.
Any Ideas what i did wrong?
And how have you set up the RFX in the GuiDesigner?
Thanks for any answer
Ben
Speaking as one fairly expert on both the Pronto PRO and the CF systems, May I strongly recommend that you drop the RFX and go with a Global Cache or similar device. You will save yourself hours of frustration. If you need a lot of RS232 outputs then there should be available several devices that will go from TCP/IP to serial. Most of them however only supply a single serial connection. I have used the one port xetaserver for $65 and I am sure the 2 port unit for $95 will work as well.
From:
comman...@googlegroups.com [mailto:comman...@googlegroups.com] On
Behalf Of MarcoB
Sent: Tuesday, January 08, 2013 9:21 AM
To: comman...@googlegroups.com
Subject: Re: How to combine hex bytes from variables in javascript
Hi Carlos,
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/mZg6QoBqcn4J.
A single GC iTach should do what you need for IR. I just do not recall if an IR port can be set as a sensor input on an iTach. It can on a GC-100. The GC-100 has 2 RS232 modules and 6 individually controlled IR ports. I use both in my home.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/zDd9S_ekDegJ.
I believe the GC-100 only support one connection at a time, where iTach’s support 8. Just fyi…