Custom Communication Driver - Cimplicity

glenglen

Member
Join Date
May 2003
Posts
24
hi everyone,

i have a code to write and read a RFID through COM port. i able to read and write to/from RFID with tag on the field. i'd like to detect when the tag is out of field. im using TAG SEARCH command, if the tag is out of field a message AAH FFH 00H 08H FFH FFH will be read. so, the below is part of my code:

Purpose:

chartx_buf[6];
char rx_buf[6];

---output command codes to RFID---
---below is echo's part ---
---i've ignored certain code ---

//read echoes from RFID byte by byte
for (i = 0; i < 6; i++)
{
port.ReadByte(rx_buf);
}
//check first byte and second byte only
if (rx_buf[0] == 0xAA && rx_buf[1] == 0xFF)
{
m_ed1 = 99;
}
else
{
m_ed1 = 98;
}

is it correct? i always get 98 but not 99. as u know, cimplicity comm. driver is very difficult for debugging, u can't trace line by line.. (right?) is anyone can tell me wat's the best way to do debugging. currently i'm using dcrp_log_status to trace my results. everytime i hv to run and stop projects, very troublesome.

im trying to trace by display rx_buf[0] only, it surpose to display 1 character only, but i always get more than 1 character. why?

regards,
glen
 
cont.

is it possible the timing problem?
for example,
when i read port.readbyte(rx_buf[0]), the data doesn't come in.
the first byte data (AAH) from RFID comes in when port.readbyte(rx_buf[3]). if this really happens, wat should i do? how do i calculate the timing?
 
Maybe this forum is not the best for C++ broblems.
My way is do some form and display for string-test only and I don't use debugger for that. After finishing hide the form and it is useless later.
 
my problem belongs to Cimplicity HMI Custom Communiation Driver and the programming is not the typical C++ coding. u can jus edit ur code in C++ IDE but u cant run it in the IDE. u mus run in in Cimplicity. however, thanks a lot.. i've solved my problem.. thank you.

regards,
glen
 

Similar Topics

Is it possible to send and receive data with a custom protocol communication for reading inputs and setting outputs? for example via TER...
Replies
0
Views
1,360
Good day! I am working on a project at our campus to integrate fleet vehicle chargers with load management so we don't overwhelm our service. The...
Replies
37
Views
3,801
I imported a customised shape into the project, but I don't know how to actually add into on to a specific HMI screen. Do I use the Graphics menu...
Replies
2
Views
658
I'm testing the ability to make a custom ActiveX control for PVP7 applications to be able to write data out in an XML format. With my simple...
Replies
0
Views
647
I am having difficulty finding documentation or examples on integrating Visual Studio with iX Developer in order to develop custom objects...
Replies
0
Views
538
Back
Top Bottom