I am working on a project with ProSim V5.4 COM Object. I am using C++ .NET under Windows XP 32 bits. I can connect to PLC-Sim, and also I can change the states, disconnect from the PLC-Sim, etc. However, when I try to read any output or flag, I just can`t get the expected result, the pointer pData is empty.
I am sure that "ByteIndex" and "BitIndex" are ok, but the function does not return anything in "pData".
The snippet below shows how I am using this function:
********************************************************
S7ProSim^ proSim = gcnew S7ProSim();
System::Boolean^ PLCSimModel::ReadOutput(int byteAddress, int bitAddress)
{
System::Object^ aux = gcnew System::Object();
System::Boolean^ value;
proSim->ReadOutputPoint((int)byteAddress,(int)bitAddress,PointDataTypeConstants::S7_Bit,aux);
value= gcnew System::Boolean(Convert::ToBoolean(aux));
return(value);
}
********************************************************
Any ideas about why this does not work?
Thanks.
I am sure that "ByteIndex" and "BitIndex" are ok, but the function does not return anything in "pData".
The snippet below shows how I am using this function:
********************************************************
S7ProSim^ proSim = gcnew S7ProSim();
System::Boolean^ PLCSimModel::ReadOutput(int byteAddress, int bitAddress)
{
System::Object^ aux = gcnew System::Object();
System::Boolean^ value;
proSim->ReadOutputPoint((int)byteAddress,(int)bitAddress,PointDataTypeConstants::S7_Bit,aux);
value= gcnew System::Boolean(Convert::ToBoolean(aux));
return(value);
}
********************************************************
Any ideas about why this does not work?
Thanks.