Hello i am new here
I work with TC for 1 week and my first definition works fine, but doesn't supprot all function in ASCII mode. I want to rewrite the defintion to HEX mode. That's wat the manual say about is. It loeks like Modbus but it also different.
It is about aan acsourse from Matrix APS-7100.
I need to say i am very happy with your work on testcontoller. The manual however is to difficult for me and i don't understand how things work together. For example how does #checksum work and when does it work?
How can i change and modify (value) before it is transmitted
I will show you my definition and i have added a lot of remarks.
#idString Matrix, APS-7100,
#name Matrix APS-7100
#handle APS7100
#port com
#baudrate 9600
#driver ASCII
#checksum sum8 binlh 0 0 0 0
#author Benleentje
#scpiCmd Current? txrxnBin? 7 \x01\x52\x60\x00\x00\x00\x00\xB3
; Checksum = B3 is hard coded this works fine for reading
; From the rx string i need bytes 4, 5, 6 and 7, byte 4 = lsb, 7 = msb.
; For reading the current it is in mA
:readmath: (((value >> 24) & 0xFF) + (((value >> 32) & 0xFF) << 8) + (((value >> 40) & 0xFF) << 16) + (((value >> 48) & 0xFF) << 24))/1000.0
#scpiCmd Voltage txrxnBin 7 \x01\x57\x33\xB0\x04\x00\x00\x3F
; 3F is chesum value sum8 but somehow TC does not at it while sending the string
#scpiCmd V txrxnBin 7 \x01\x57\x33((value))
;I want value to be converted to 4 bytes (not ascii)
; The protocol is not modbus, but it is simulair.
; Total 7 bytes of data + checksum,
; id nummer, 1 byte
; command ( read, write or reset), 1 byte
; function code ( = register adres), 1 byte
; Data, 4 bytes with high byte follows low byte
; chesum sum8 over 7 bytes
; x01 is id nummer
; x57 write data and x52 read data, 0x58 = reset
; x33 is register adres to write to as example
; value is Always 4 bytes to read or write
; 120.0V = 1200 = B0 04 00 00
; The 7 bytes checksum sum8 has to be calculated and add to string before sending it
#value Current A D3
#askValues Current?