Hello,
I tried to modify program, but still I have some problems. If I try to send a message in order to get status Device controle (param10 in EDS file), I obtain nothing.
Example code:
MODULE Module1
CONST robtarget home:=[[511.36,-7.11,714.35],[0.709925,0.0106723,0.704196,0.000937047],[-1,-1,0,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget target1:=[[511,-7.11,400],[0.709925,0.0106723,0.704196,0.000937047],[-1,-1,0,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget board1home := [[223.04,-154.57,-159.66],[0.613404,-0.560875,-0.422732,-0.36118],[-1,0,-3,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_10:=[[476.377532198,75.790964764,329.998886795],[0.006634996,0.000000077,0.999977988,-0.000000033],[0,-1,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_20:=[[476.377564349,-79.852510653,329.999196286],[0.006635425,-0.000000054,0.999977985,-0.000000177],[-1,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_30:=[[476.377648812,-1.144353486,329.999431058],[0.006635615,-0.000000149,0.999977984,-0.000000072],[-1,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
VAR num dlugosc;
VAR iodev io_device;
VAR rawbytes raw_data_out;
VAR rawbytes raw_data_in;
VAR num input := 46;
VAR string return_status;
VAR string return_status_in;
VAR string wynik := "0";
VAR byte bit := 122;
CONST robtarget Target_50:=[[476.377617427,-1.144352136,470.80365528],[0.006635644,-0.000000406,0.999977984,-0.000000065],[-1,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
PROC main()
MoveJ home,v1000,z100,tool0\WObj:=wobj0;
devicenet;
MoveJ target1,v1000,z100,tool0\WObj:=wobj0;
MoveJ home,v1000,z100,tool0\WObj:=wobj0;
Stop;
ENDPROC
PROC devicenet()
wynik := ByteToStr(bit);
Close io_device;
ClearRawBytes raw_data_out;
PackDNHeader "0E", "6,20 64 24 01 30 0E,**207D,00**", raw_data_out;
! I think here is the main problem - how to correct define PackDNHeader based on EDS file?
PackRawBytes input,raw_data_out,(RawBytesLen(raw_data_out)+1) \INTX := UDINT;
dlugosc :=RawBytesLen(raw_data_out)+1;
Open "/FCI1:/IED_device_unit", io_device \Bin;
!trzeba znalezc ID w plik EDS urzadzenia IO, aby otworzyc z nim polaczenie
WriteRawBytes io_device,raw_data_out;
ReadRawBytes io_device,raw_data_in\Time:=1;
Close io_device;
UnpackRawBytes raw_data_out,9,return_status \ASCII:=46;
UnpackRawBytes raw_data_in,9,return_status_in \ASCII:=46;
ENDPROC
ENDMODULE
If you have some suggestions, please let me know.