How to use ScratchpadStringRead from OptoMMP .NET

I am using Visual Studio C# Express 2010

I am able to write string messages using ScratchpadStringWrite to may SNAP-PAC-R1-W controller but am unable to read string messages using ScratchpadStringRead.

Here is my example code and error messages.

C# code:

// 1.1. define Rx String
String[] strReadArray = new String[64];

// 1.2. try to read scratch pad string data from SNAP-PAC-R1-W controller
// 2.1. read string data
this.i32Result = this.OptoMMP2_Controller.
ref strReadArray, 0, strReadArray.Length, 0);

  // 2.2. defines for error reporting
  string strErrorData = String.Empty;
  bool bCommFault = false;
  bool bProtocolFault = false;
  bool bArgumentFault = false;

 // 2.3. capture error msgs
                       out strErrorData,
                       out bCommFault,
                       out bProtocolFault,
                       out bArgumentFault);


} // end try

this is the return message:

“Expected response size does not match the expected device response.”
“CommFalut: True.”
“ProtocolFault: False.”
“ArgumentFault: False.”

Here is my Pack Conrol String Scratch Pad Code:

Set I/O Unit Scratch Pad String Table
I/O Unit PipePickupControl
Length 64
To Index 0
From Index 0
From Table strtbl_For_Test
Put Status in n32_Write_String_Status

I write 64 words from strtbl_For_Test 64 strings of the word “none” to the
scratch pad string table.

I declare my string length in the table as 16 bytes. I have made it 128 but with no
difference in my error response.

Again I am able to write to the scratch pad string data but I am not able to read it.

Any answers?

Thank you,


Welcome to the forums. Nothing is jumping out at me on this one. You might want to contact PSG (our Product Support Group) for some FREE! help sorting this out. Once you do, please share what you learned so others might benefit from your new-gained knowledge.