![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
![]() Join Date: Oct 2003
Posts: 5
|
read/write error of main sequence program of mitsubishi a series plc
Hi,
I am writing java code to read the Main sequence program from mitsubishi A series CPU namely A1SCPU. The default capacity of this program is 6k steps (6 * 1024 = 6144 steps). Now each step has 2 bytes hence 12k (1024 * 12= 12288)bytes in total to be read Now since one can read maximum of 256 steps in one exchange I have to loop to read all the 6 k steps. The problem is when i am trying to read the last step. i.e 6143 rd step it gives an end code of 5B (hex) with 13(hex) as error code which says that a step no. that exceedsthe program capacity range set by the pc cpu parameter. Is is a valid failure?. If I read one step less there is no problem. Similar problem happen if I write onto the plc. Does any body know why I get the error ? here is the code of reading the sequnce program private byte[] readMain() { byte[] readMain = new byte[] { 0x0A, // command code (byte) 0xFF, // local station 0x00, // lower order byte of ACPU monitor timer 0x00, // higher order byte of ACPU monitor timer 0x00, // lower order byte of head step no. 0x00, // higer order byte of head step no. 0x00, // number of steps (specify 00h for 256 steps) 0x00}; byte[] buffer = new byte[12288]; // 12k int head = 0; for (int i = 0; i < 24; i++) { readMain[4] = (byte) (head & 0xff); readMain[5] = (byte) ((head >> 8) & 0xff); send(readMain); // sends the packet byte[] temp = ..... // received packet of bytes // check the end code if (temp[1]== 0x00) // no error { System.arraycopy(temp,2,buffer, head * 2,512); head += 256; } else { // some problem /error System.out.println("End code is "+temp[1]); } } return buffer; } |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PLC Program Management | zmanvortex | LIVE PLC Questions And Answers | 5 | November 1st, 2004 10:03 AM |
| Mitsubishi FX series PLC? | Ken | LIVE PLC Questions And Answers | 11 | December 11th, 2002 01:54 PM |
| Mitsubishi PLC FX 1N series | Deepak Bodhani | LIVE PLC Questions And Answers | 0 | June 29th, 2002 06:55 AM |
| Mitsubishi PLC FX-1N series | Deepak Bodhani | LIVE PLC Questions And Answers | 0 | June 29th, 2002 06:24 AM |