read/write error of main sequence program of mitsubishi a series plc

fatema

Member
Join Date
Oct 2003
Posts
5
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;
}
 

Similar Topics

I havePLC: CPU S7-300-2 PN/DP (6ES7 315-2EH14-0AB0) And I am using TIA Portal v13 including (Step7 Professional SP1 Update 8, WinCC Professional...
Replies
12
Views
3,229
Hi, Our controllogix connected to panelview thru controlnet with CNB @ node 1 & panelview @ node 9. When i download modified program to the...
Replies
5
Views
8,753
Hi guys, Iam trying to introduce numeric entry code to input the data into the plc. But it gives the write fail error to the tag address in...
Replies
5
Views
1,766
Hi all, Iam trying to have numerical keypad entry into the plc from panelview. The program I have for the panel view screens is all...
Replies
4
Views
1,966
Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
152
Back
Top Bottom