I have created the code to send and receive the values from the controller to the PLC via a ProfiNET.
What kind of values?
As mentioned before, I am new to KAREL. I am reading documents and learning through the threads created here.
Where did you get the informations for those variables like f.e. "bHCodeREQ". For me this looks like an overboarding fantasy.
Communicating via Profinet normally works with single bits, groups of bits as unsigned integer or analog values. It's just the same as in TP programs.
So if you have a working Profinet connection to the PLC, you can use DOUT[]/DIN[], GOUT[],GIN[] or AIN[] AOUT[].
Code
PROGRAM WRITEHM
%COMMENT = 'WRITEHM'
%NOLOCKGROUP
%NOBUSYLAMP
%NOPAUSE = ERROR+COMMAND+TPENABLE
%PRIORITY = 1
%TIMESLICE = 8
%DELAY = 8
%ALPHABETIZE
%NOPAUSESHFT
--%INVISIBLE
--%
--%CMOSVARS
%NOABORT= ERROR + COMMAND
--SECTION 2 constant and variables declaration
VAR
input_Nr1 : INTEGER;
--SECTION 4: MAIN PROGRAM
BEGIN
DOUT[10]=ON;
GOUT[1]=123;
input_Nr1=GIN[1];
END WRITEHM
Display More