Communication between PC & VersaMax Using SNP

theglen

Guest
T
Hi everyone,

i've encountered some problems during communication between PC and VersaMax using SNP. i'm using borland builder C++ 5.0. i've opened the port successsfully. i connected my PC to other PC and that PC ables to receive characters in HyperTerminal. the following are my code:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
SendAttachMessage();
Sleep(1000);
ReceiveResponseMessage();
}
void TForm1::ReceiveResponseMessage(void)
{
DWORD read_dwBytesTransferred = 0;
ReadFile(comm_port, &response_buf, 24, &read_dwBytesTransferred, 0);
}
void TForm1::SendAttachMessage(void)
{
BYTE msg_buf[24];
BYTE *msg_buf_ptr = msg_buf;
DWORD read_iBytesWritten = 0;

*msg_buf_ptr++ = 0x1b; //start message character - 1bh
*msg_buf_ptr++ = 0x41; //message type character - 41h
*msg_buf_ptr++ = 0x33; //CPU ID - "33101A"
*msg_buf_ptr++ = 0x33;
*msg_buf_ptr++ = 0x31;
*msg_buf_ptr++ = 0x30;
*msg_buf_ptr++ = 0x31;
*msg_buf_ptr++ = 0x41;
*msg_buf_ptr++ = 0x00;
*msg_buf_ptr++ = 0x00;
*msg_buf_ptr++ = 0x30; //T1 value - 10ms
*msg_buf_ptr++ = 0x41;
*msg_buf_ptr++ = 0x30;
*msg_buf_ptr++ = 0x30;
*msg_buf_ptr++ = 0x30; //Reserved, set to 30h
*msg_buf_ptr++ = 0x20; //Reserved, set to 20h
*msg_buf_ptr++ = 0x20; //Reserved, set to 20h
*msg_buf_ptr++ = 0x20; //Reserved, set to 20h
*msg_buf_ptr++ = 0x17; //End of block character - 17h
*msg_buf_ptr++ = 0x00; //Next Message Type - 00h
*msg_buf_ptr++ = 0x00; //Next Message Length - 0000h
*msg_buf_ptr++ = 0x00;
*msg_buf_ptr++ = 0x38; //BCC
*msg_buf_ptr = 0x35;

WriteFile(comm_port, &msg_buf, 24, &read_iBytesWritten, NULL);
}

i able to send my message to PLC but there is no response from PLC. what's the problem? by the way, what is CPU ID? is it same with SNP ID in the VersaPro?

thank you very much.

regards,
goh
 
theglen:

"The SNPID property is a user-defined node address assigned to a
specific PLC using [...] programming software or
equivalent. This property can be set to NULL (empty) when
communicating point-to-point
, but is required to be set when
communicating on a multi-drop SNPX network."

This is a quote from the manual for In-Gear ActiveX Control for GE PLCs, see here: http://www.softwaretoolbox.com/store/item_pages/itempage_523.asp

I honestly can't understand what kind of business would make $899 list price for this product (and I'm sure it can be negotiated for less) more expensive than the time you are spending designing and debugging your own custom solution times whatever overall hourly rate is in your place. Can you complete this development in 200 hours? Are you costing your employer no more than $4.50 an hour?

Unless, of course, you are building a competing product with the intent to sell it in quantity... Good luck, then.
 
I agree with LadderLogic -- you might get faster results to just purchase a 3rd-party driver. There are several VERY nice ones on the market that you just drop into VB (or even EXCEL) and allow you to read/write PLC addresses. I even saw one the other day that is being sold for $49!

Writing a driver has to be done VERY carefully, because if anything goes wrong, you could unintentionally turn on/off bits and damage equipment or people.
 

Similar Topics

I'm trying to write a data in Arduino using MODWR function block .I used the code I got from online for both PLC and Arduino. I made the wiring...
Replies
4
Views
80
Or there is an alternative to this? I suppose there are many but I've only seen put/get Can you for example set up a new plc and connect it to an...
Replies
5
Views
298
Communication between devices will stop working for a certain period of time. I caught the error message using WireShark. I cannot identify the...
Replies
0
Views
98
I am having trouble running the application throught my PLC, tm221me32tk with magelis HMIGTO6310 I have prepared the plc programme, also created...
Replies
0
Views
106
Hi, I am trying to send data register type (D) from Toyopuc PC10g to FX5u. Does it possible to connect both plc using fx5u features which is...
Replies
1
Views
30,618
Back
Top Bottom