Hi,
I am wondering if someone already has experience with the following:
I want to read position data from a display from Heidenhain (ND 280: http://content.heidenhain.de/doku/oma_nd_pt/html/de/oma-en/index/1242135143200/1242135143141/1242135143141.html), which has a RS232 interface.
Question is: Will I get the data into my CR1000 with the SerialInRecord() command?
KR,
Ponce
I found the manual and the output looks fairly simple.
The data format is fairly simple, but SerialInRecord() might not be the best. The device has a polled interface, so you can reliably get data with SerialIn
I would recommend the following:
SerialFlush
Pulseport for 65ms on the trigger line
SerialIn Use 13 for termination character 15 for timeout
The other way to trigger it is outputting a Ctrl B character with SerialOut or SerialOutBlock.
If you configure the RS232 port for connection to the device, beware that you won't be able to connect your PC to the CR1000 on the RS232 port. You could configure a pair of control ports like Com4 for Pakbus communication. You can do that simply by setting a baud rate for the comport on the datalogger using DevConfig.
Hi JDavis,
thanks for the feedback. We will have the device today and hopfully get it up and running. Was really a nightmare to get the data out of the encoder. I'll let you know about the advances...
KR,
Ponce
Hi JDavis,
I am trying to do the output CTRL B via Serialout(). Question I have is: What do I have to write to get the CTRL-B command communicated via the RS232 port.
KR,
Ponce
Hi JDavis,
works! I am using the following program:
BeginProg
Scan (1,Sec,500,0)
SerialOpen(ComRS232,115200,2,20,500)
SerialFlush(COMRS232)
SerialOut(COMRS232,CHR(2),"",0,100)
SerialIn(Dir,COMRS232,10,13,100)
CallTable Test
NextScan
EndProg
The output is something like - 179.887 G. Now I am facing a problem how to convert that to floating point number.
Thanks for the help!
KR,
Ponce
The easiest way to get a the floating point number out is to use SplitStr with the Numeric option.
Right. Just did that. Only thing I am missing now is the sign (+ or -) for the angle...
Done! Works with Replace() command. Thanks JDavis!!!