This article is not avalaible in english as it concerns a french forum only.
So here is first post of a new serie of articles, that’ll be dedicated at help about basic functions you might need in your program. We’ll start today with a module named Timer. You’ll get a little keypad to compose time in minutes, a clean button, and a play/stop button. You dial time you want, it’s displayed in little box, you push play, timer starts to count down till 0. If you push stop, it stops and reset counter. When it’s at 0, it’ll do something you setup in module.
Module ready to use is here. (I know touch panel pages are ugly but it’s just a demo of concept
Enjoy it and if you have any comments feel free to post below !
So today I went on site for interfacing a NetLinx AMX system with Sauter HVAC system. The HVAC system is interfaced through a PC that translates internal bus to more regular Modbus/Jbus protocol.
Modbus is a pretty simple protocol but its implementation is not so simple due to three facts:
- It uses a pretty complex system to calculate a mandatory checksum at end of each message. But with help of a friend Jon, and also piece of code made by Crestron for their Modbus module, I was able to automate creation of Modbus messages in my NetLinx program. Here is result for exemple for a read command:
- Second problem is for answer you get back from HVAC as temperature value is coded with IEEE system. I looked at it on internet but it looks pretty complex to encode, so for now I just do a comparison between know values and it allows me to get correct value, at price of extra comparison work but it functions perfect If someone already did a piece of code in NetLinx to encode/decode IEEE value, I’m interested in !
- Last point very important with Modbus protocol is that it doesn’t speak by itself So each time you want to know something you have to issue a read command. So best way is to use a timeline you run in background that continuously asks values at system so you keep always value up to date
TEMP = “1,3,0,((ETAPE-1)*4),0,2″
CRC = $FFFF
TEMP_1 = TEMP[I]
XFLG = (CRC^TEMP_1) & $0001
CRC = CRC >> 1
CRC = CRC ^ $A001
TEMP_1 = TEMP_1 / 2
I = CRC / 256
J = CRC – (I*256)
INTERRO_A_ENVOYER = “TEMP,J,I”
That sample computes automatically checksum for a read message of two bytes
Hope it helped you, and feel free to ask questions you might have in comments !