Jump to content

swieru

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by swieru

  1. Hello, I am trying to write very basic script to use COM object. It is a specific object allowed to communication with software on the industrial controller. I can create reference to a COM object by function ObjCreate. Thanks to ObjectName function I can read all information about object. Problem is that, I can trigger (only) one method of this object, named Disconnect(). When I want to use the other method instead of Disconnect(), for example, ReadValueN I have problem with arguments for this method. I tryed many variants, combinations, without positive result. My error monitoring function (for COM errors) reports: "Bad variable types" or "Type mismath". I studied many examples, many documentations but I have no idea how it should be. Below is description for method, data etc based on OLE/ COM Object Viewer. long ReadValueN( [in] long TARGET_id, [in] PARAM_DEF* pParamDef, [out] BUFFER* pResBuffer);typedef struct tagPARAM_DEF{ unsigned char Param1; unsigned char Param2; unsigned char Param3; unsigned char ParamT[8]; short Number; unsigned char ValueF; unsigned char ValueD; } PARAM_DEF; typedef struct tagBUFFER{ unsigned char BuffA1; unsigned char BuffA2; unsigned char BuffA3; unsigned char BuffTable[256]; } BUFFER;$structParamDef = DllStructCreate("byte; byte; byte; byte[8]; short; byte; byte") $structBuffer = DllStructCreate("byte; byte; byte; byte[256]") $response = $myObject.ReadValueN(0, DllStructGetPtr($structParamDef), DllStructGetPtr($structBuffer)) ;$response = $myObject.Disconnect() ; is workingCould someone write me what is wrong and how it should be? And especially - why? thanks in advanced
×
×
  • Create New...