7/23/2013 9:02 AM | |
Posts: 22 Rating: (0) |
Dear friends, I am using my PLC to read data from a scanner connected by Ethernet(TCP/IP). I have a 343-lean CP card installed on my PLC. I write this program to receive a variable length of barcode information. Everything looks fine(no errors, no complains from the STATUS value) but I just simply couldn't get the characters from my variable table. Could somebody take a look at this simple program and help me identify the issue? AttachmentTcp_variable.zip (142 Downloads) |
7/23/2013 9:13 AM | |
Posts: 3093 Rating: (323)
|
Hello Vincent, do you get the NDR bit at AG_RECV? Regards, Kaulquappe |
7/23/2013 9:21 AM | |
Posts: 22 Rating: (0) |
Dear friend, As you can see in my testing result, I do get the NDR from the program, which suggests, it detects the end of the string.
|
7/23/2013 10:50 AM | |
Posts: 3093 Rating: (323)
|
Hello Vincent, did you set the pointre RECV_AREA properly? It seems to be zero. Regards, Kaulqauppe |
7/23/2013 2:57 PM | |
Posts: 22 Rating: (0) |
This is my code for the POINTER part: LAR1 P##RECV_AREA //Load the starting address of the Area pointer to AR1 L W [AR1,P#0.0] T LW 0 //Copy the first 3 Word into local data stack 0 L W [AR1,P#2.0] T LW 2 L W [AR1,P#4.0] T LW 4 //Count is the curren length, and -1 makes it an offset of the current position to be copied. L #COUNT L -1 AD T #COUNT SLD 3 // make it a pointer L D [AR1,P#6.0] +D T MD 6 //load byte 6 - 9 of ANY pointer to the temporary buffer Is this correct?Why is it 0? I don't see anything suspicious here..
|
7/23/2013 3:09 PM | |
Posts: 3093 Rating: (323)
|
Hello Vincent, an ANY pointer consists of 10 byte. You can't store it in a double word. Regards, Kaulquappe |
7/23/2013 3:17 PM | |
Posts: 22 Rating: (0) |
Hi The first 3 lines contains the first 6 bytes of the ANY pointer, and with a double word they become a ANY pointer, and is stored in a local data stack.. I am not sure if the last line is just a typo or is a mistake.. When I say MD 6, i do mean LD 6.. I will test this tommorrow when I come back to office.. |
Last edited by: Vincent YuHang at: 7/23/2013 3:21 PM |
|
7/24/2013 7:36 AM | |
Posts: 22 Rating: (0) |
Thanks friends, but I have the problem solved. |
This contribution was helpful to1 thankful Users |
8/27/2013 5:12 AM | |
Posts: 1 Rating: (0) |
Hello Vincent, How you fix the problem? Can you send me your code? I am also trying to read a Serial Barcode Scanner using an Serial to Ethernet converter. Thanks in advance, Regards PC
|
Follow us on