I have just purchase the 1 Channel Push Notification contact closure input over usb device and the USB Communications module.
I have connect the device via the USB port, install the vCom port driver for the FT232R driver from you web site, and have configure my comport and my software(vb.net) to use 115200 baud rate.
When I close the contact i do get data from the device, but i can’t figure out the data as I am clearly doing something wrong.
What I get back is
“?N” & ChrW(1) & vbNullChar & vbFormFeed & vbFormFeed & vbFormFeed & vbFormFeed & vbFormFeed & vbFormFeed & ChrW(1) & ChrW(2) & ChrW(3) & ChrW(4) & ChrW(5) & ChrW(6) & ChrW(7) & vbBack & ChrW(1) & ChrW(1) & vbNullChar & “q”
In my vb.net code i simply open the port and on a datarecieved event handler i readexisting data whcih is the data above…
Am i missing something here?? I must be doing something wrong…
Thanks for you help…
Page 9 of the user guide for the push notification devices outlines the packet structure for the data output by the device:
These are decimal formatted bytes so make sure you are parsing the received data as a byte array, not an ASCII string.
Thanks for this, and i have managed to get the data from the board as requried when the contact is either open or closed using an eventhandler on recieving data from the serial port.
However… i am now stuck with my final little task… when the software first starts up, i need to be able to request the current state of the contact closure… in this situation no data is sent from the board as there has not been a state change of the contact.
I see the document the section called direct query command set, but i can;t figure out (lack of knowledge on my side) what i need to do. do i have the 8bit analog inputs, or the multi channel 8-bit… I tried to just write directly to my comport the following “comport.write(254)” thinking well thats sending 254 decimal down the serial port, and hoping that the board would then send databack to my app which would cause the recieve event handler to fire and i could capture the data in the same way i capture to data when the contact state closes…
But i get nothing back… i am 99% i am not sending the correct data or correct way but i have no idea what is the correct way…
Can you give a small example on how to send a direct query so i can get the closure contact state…
You need to write two bytes of data to the serial port(254, 166). The board will respond with 8 bytes(one for each input on the board, if you only have a 1 channel input board you would just look at the first byte.