03-25-2013 01:24 PM
Hi
See original post:
ComLynxUserGuide15THE20110513.pdf 386 KB
http://forums.ni.com/ni/attachments/ni/170/641225/1/ComLynxUserGuide15THE20110513.pdf
Good luck
Mick
03-25-2013 01:30 PM
Already did that, but that didnt make much sence to me, I know it describes the protocol, but have no idea what to do with it, like how to send requests to the inverter for instance, completely blank on the area.
03-25-2013 01:55 PM
Hi DonTommy
I'm on vacation right now, so I don't read my emails very often.
I Think An Adam RS485 converter should handle it.
You are much further ahead than I, maybe you should try asking Danfoss about which converter they can recommend.
Tommy
03-25-2013 02:50 PM
Hi
As far as I can tell:
The basic message format of both the request and reply is shown in the example on page 26. The parameters to use in the request for individual values are shown in Appendix 7.3.
All the best
Mick
03-25-2013 04:02 PM - edited 03-25-2013 04:04 PM
Thanks Mick, can you guide me a bit more, i can see the "logic" on page 26, however having a hard time understanding how a request like that on page 26 is going to be sent to the inverter
03-25-2013 04:39 PM - edited 03-25-2013 04:48 PM
I have constructed some code, cant test it before the sun comes up, so if any of you got some pointers on my small python code I am more then happy to listen 🙂
(the hex code in the struct line is just the values from page 26 in the comlynx manual for requesting total production)
import serial
import struct
ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate=19200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
print(ser.isOpen())
data = struct.pack(hex, 0x7E, 0xFF, 0x03, 0x00, 0x02, 0x12, 0x03, 0x0A, 0x01, 0xC8, 0x04, 0xD0, 0x01, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8E, 0xE7, 0x7E)
ser.write(data)
s = ser.read(1)
print(s)
ser.close()
03-25-2013 11:17 PM
You can convert a byte array (U8) to a string, then write the string using a VISA Write.
Or you can enter your data into a string constant with it set to Hex display, and use VISA Write to write that.
03-26-2013 06:55 AM
Hey again, getting closer.... i hope:)
Got this python code:
ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate=19200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
print(ser.isOpen())
data = "\x7E\xFF\x03\x00\x02\x11\x01\x0A\x01\xC8\x04\xD0\x01\x02\x80\x00\x00\x00\x00\x8E\xE7\x7E"
ser.write(data.encode(encoding='utf-8'))
while True:
s = ser.readline().decode('utf-8')
if s:
print(s)
ser.close()
No errors from python on execute, however it dosnt return anything from what I can see. So I guess my problem is that the master and slave adresses isnt set correctly, in the comlynx protocol manual, they always refferes to the master as being on adress 0,0,2 and a diagram shows that the first inverter on a network is 1,1,1, have tryed guessing other numbers with no luck.
My adam 4520 converter, is having the green led light on always, which means no data being transfered from what I have seen on their webpage, but should that change the moment I try to sent a request, no matter if the master/slave adress is wrong?
03-26-2013 08:47 AM
Where are your LabVIEW questions? You are talking about Python.
04-03-2013 07:08 AM
Hi DonTommy
I have contacted Danfoss, and they say their converter is specially encoded and can not be bought anywhere other than at Danfoss, the price is 103 EUR