Write to a bit of array in plc

710 views
Skip to first unread message

ms ns

unread,
Jan 29, 2021, 9:03:31 AM1/29/21
to libplctag
Hi,

I have an array as CommFromPalletizer (DINT[5]). The CommFromPalletizer[0].3 is the load complete signal. When this turns on the completedLoad tag array should be read. Then I would set the CommToPalletizer[0].1 this is the acknowledge signal.

The [0] is the first double integer word in the “CommFromPalletizer” tag array and .3 is the 4th bit in this word. But whenever i try to write the tag I am getting the error code of -4. Please let me know how I can solve this problem.

Kyle

unread,
Jan 29, 2021, 9:47:25 AM1/29/21
to libplctag
Hi, thanks for using the library and bringing this up! 

To make sure, are you writing the entire array or just bit 1?  Are there any protections enabled in the PLC on this tag?  Are you setting this up as two bit tags?  One to read the load complete signal and one to write the ack signal?  What is the exact tag string you use for reading ?  What is the exact tag string you use for writing?

Can you run a write test with debugging output on (level 4) and capture the output?   I.e.

tag_rw -t bit -p 'protocol=ab-eip&gateway=....&elem_count=1&name=CommFromPalletizer[0].1' -w 1 -d 4 &> log

(this is for Linux/macOS, you will need to modify it for Windows)

This will help me understand what error you are getting and where that error is occurring.

Best,
Kyle

ms ns

unread,
Jan 29, 2021, 9:59:46 AM1/29/21
to libplctag
Hi Kyle, I have two tags CompletedLoad and CommFromPalletizer. I have succesfully read the CompletedLoad tag. But now I have to read and write CommFromPalletizer[0].3  tag array and .3 is the 4th bit in this word. 

Please find the attached screenshot.
 test.PNG

Now when I have successfully read the CompletedLoad tag then I have to write to the CommFromPalletizer[0].3 to "1" . The CommFromPalletizer[0].3 is the load complete signal. When this turns on the completedLoad tag array should be read. Then you would set the CommToPalletizer[0].1 this is the acknowledge signal that I have read the completedLoad tag array. 

This is my code to write

tag = new Tag("192.168.1.99", "1,0", CpuType.LGX, "CommFromPalletizer[0]:3", DataType.DINT, 1);

                client.AddTag(tag);
                while (client.GetStatus(tag) == Libplctag.PLCTAG_STATUS_PENDING)
                {
                    Thread.Sleep(100);
                }

                if (client.GetStatus(tag) != Libplctag.PLCTAG_STATUS_OK)
                {
                    Console.WriteLine($"Error setting up '{tag.Name}' internal state. Error {client.DecodeError(client.GetStatus(tag))}\n");
                    return;
                }
                /* TAG_STATUS_WORD */
                var statusVal = client.GetUint32Value(tag, 0);
                if (statusVal == 0)
                    statusVal = 1;
                else
                    statusVal = statusVal * 2;
                Console.WriteLine($"setting 'STATUS_WORD' = {statusVal}\n");
                client.SetUint32Value(tag, 0, statusVal);
                int rc;
                rc = client.WriteTag(tag, DataTimeout);


But I am receiving the status code of -32 or -4.

ms ns

unread,
Jan 29, 2021, 10:00:26 AM1/29/21
to libplctag
What is the test debug for windows and should I use this string in the commad prompt?

Kyle

unread,
Jan 29, 2021, 6:16:14 PM1/29/21
to libplctag
Ah, OK, you are using a wrapper.  Looks like C#?  Which wrapper are you using?

Error 4 is means that the library received weird or unexpected data from the PLC or as input.   Error -32 means a timeout.

You can download the C DLL and compiled tests and examples here.  Pick the right ZIP file for you Windows CPU type (64-bit or 32-bit x86).   Unzip that into a directory somewhere and you will see the plctag DLL and tag_rw.exe executable.   Make sure those are in the same directory and run the executable on the command line (cmd.exe works fine). 

I do not remember how to redirect output on Windows.  Maybe is it ">" as in Unix-like systems?   I do remember that the tag string must be in double quotes.  It looks like it would be something like this:

tag_rw.exe -t bit -p "protocol=ab-eip&gateway=192.168.1.99&path=1,0&plc=ControlLogix&name=CommFromPalletizer[0].3" -d 4 > log.txt

In typing this up I noticed that your tag name uses a colon ":" for the bit field.  In the core C library it is ".".   Instead of "CommFromPalletizer[0]:3" make sure you use the tag name "CommFromPalletizer[0].3".

If you get back a good value from the tag_rw.exe program the we know that the core library is working fine with your tag.   Once that works try adding a write to the bit:

tag_rw.exe -t bit -p "protocol=ab-eip&gateway=192.168.1.99&path=1,0&plc=ControlLogix&name=CommFromPalletizer[0].3" -d 4 -w 1 > log.txt

If the bit is already 1, change the 1 to a 0 (zero).

I hope this helps!

Best,
Kyle

ms ns

unread,
Jan 30, 2021, 1:57:17 AM1/30/21
to libplctag
Thanks kyle you are being very helpful. I did what exactly you told me and this is the error in my log file. I am totally new to this. I am using LibplcTagWrapper dll.

Library version 2.2.0.
Arg[0]=tag_rw.exe
Arg[1]=-t
Arg[2]=bit
Arg[3]=-p
Arg[4]=protocol=ab-eip&gateway=192.168.1.99&path=1,0&plc=ControlLogix&name=CommFromPalletizer[0].3
Arg[5]=-d
Arg[6]=4
ERROR PLCTAG_ERR_NOT_FOUND: error creating tag!

Kyle

unread,
Jan 30, 2021, 9:33:24 AM1/30/21
to libplctag
Hi,

Did you get any more output than that?   There should be a lot of lines like this:

./tag_rw -t bit -p 'protocol=ab-eip&gateway=10.206.1.40&path=1,4&plc=ControlLogix&name=TestDINTArray[0].1' -d 4
Library version 2.2.1.
Arg[0]=./tag_rw

Arg[1]=-t
Arg[2]=bit
Arg[3]=-p
Arg[4]=protocol=ab-eip&gateway=10.206.1.40&path=1,4&plc=ControlLogix&name=TestDINTArray[0].1

Arg[5]=-d
Arg[6]=4
2021-01-30 06:18:58.930 thread(1) tag(0) INFO plc_tag_create:578 Starting
2021-01-30 06:18:58.930 thread(1) tag(0) INFO initialize_modules:177 Starting.
2021-01-30 06:18:58.930 thread(1) tag(0) INFO initialize_modules:186 Creating library mutex.
2021-01-30 06:18:58.930 thread(1) tag(0) DETAIL mutex_create:615 Starting.
2021-01-30 06:18:58.930 thread(1) tag(0) DETAIL mutex_create:637 Done creating mutex 0x55c2ce6c19b0.
2021-01-30 06:18:58.930 thread(1) tag(0) INFO initialize_modules:207 Initialized library modules.
2021-01-30 06:18:58.930 thread(1) tag(0) INFO lib_init:130 Setting up global library data.
2021-01-30 06:18:58.930 thread(1) tag(0) INFO lib_init:132 Creating tag hashtable.
2021-01-30 06:18:58.930 thread(1) tag(0) INFO hashtable_create:75 Starting
2021-01-30 06:18:58.930 thread(1) tag(0) INFO hashtable_create:99 Done
2021-01-30 06:18:58.930 thread(1) tag(0) INFO lib_init:138 Creating tag hashtable mutex.
2021-01-30 06:18:58.930 thread(1) tag(0) DETAIL mutex_create:615 Starting.

I am using the next version of the library which has not been released yet, but the only difference is the Pascal wrapper.  You should see the logging above with all the time stamps and thread information.   That tells me what the library is doing internally and you can see the individual packets to and from the PLC.

I looked up the Windows redirection command syntax and the command line you should run will look like this, notice the part at the end after the log.txt file name.  That is very important to redirect stderr into the log:

tag_rw -t bit -p "protocol=ab-eip&gateway=192.168.1.99&path=1,0&plc=ControlLogix&name=CommFromPalletizer[0].3" -d 4 > log.txt 2>&1

Then the log information will be in the file log.txt.  Make sure to double check that your PLC is:
  1. A ControlLogix, if not, please correct the type.
  2. That the CPU module is in slot 0.  That is what the path is saying.   If it is not in slot zero please correct the last number in the path to the correct slot number.
  3. That you have the correct tag name.  You can use the list_tags.exe example program to list tags.  You would run it like this on the command line:
C:\somedirectory> list_tags "192.168.1.99"  "1,0"

Can you please try that and attach the results here?

Best,
Kyle

ms ns

unread,
Jan 30, 2021, 9:56:51 AM1/30/21
to libplctag
Hi Kyle, 

I have listed down all the tags and it came into my knowledge that tags was not listed in the plc? Is the tag not created or I am not able access that tag? What could be the possibility?. Please find the attached log file as well.


log.txt

Kyle

unread,
Jan 30, 2021, 10:53:18 AM1/30/21
to libplctag
Hmm...  Yes, it looks like you have either the wrong name or the tag is not there:

2021-01-30 07:42:18.337 thread(1) tag(0) WARN check_read_status_connected:1541 CIP read failed with status: 0x4 IOI could not be deciphered or tag does not exist.

I found this in the log.   The PLC is saying that your tag, as named, does not exist.   Is it a program tag?   There are at least two "levels" of tag, the controller or top level, and then tags in each individual program.

When you list the tags, what do you see?   Can you send that to a log file and attach that?

list_tags "192.168.1.99"  "1,0"  > tags.txt   2>&1

If your tag is a program tag, it will be in the list, but with a prefix something like this: Program:SomeProgram.CommFromPalletizer[0].3.

I am not sure if the tag will be listed if it is protected from access.

Best,
Kyle

ms ns

unread,
Jan 30, 2021, 11:03:01 AM1/30/21
to libplctag
I am attaching the list of tags. Let me know the possibilities why am I not able to read or write it. Or if I want to how can I achieve that.  
tags.txt

ms ns

unread,
Feb 1, 2021, 4:04:53 AM2/1/21
to libplctag
Hi Kyle, 

Any help for this?

Regards

Kyle

unread,
Feb 1, 2021, 9:48:27 AM2/1/21
to libplctag
There appear to be only three possibilities:
  1. The tag does not exist in that PLC.  I.e. you have the wrong PLC.
  2. The tag is protected from use and you cannot see it from outside the PLC.
  3. The tag is under a different name.  Is it perhaps a field of some other UDT?
Use Studio 5000 to see where this tag is and what the name should be.  If it is public and in the target PLC, you will be able to read and write it.   If it is protected and not visible from outside the PLC, you will need to make it visible or make a visible alias for it (I think that works, you will need to try).

At this point it looks like all the possible solutions are outside the libplctag library.

I hope that helps!

Best,
Kyle



ms ns

unread,
Feb 2, 2021, 5:30:30 AM2/2/21
to libplctag
Thanks so much. 

ms ns

unread,
Feb 2, 2021, 6:36:37 AM2/2/21
to libplctag
Hi Kyle,

So a new tag is created CommToInfeed[0].3 and I can actually read and write it from cmd but when I try to read it through code I get an error of Err_Bad_Param The status code of -7. Here my connection string
 protocol=ab_eip&gateway=192.168.1.99&path=1,0&cpu=LGX&elem_size=4&elem_count=4&name=CommToInfeed[0].3

ms ns

unread,
Feb 2, 2021, 7:02:32 AM2/2/21
to libplctag
Please find the attached debug screenshots. 
log1.PNG
log3.PNG
log2.PNG

ms ns

unread,
Feb 2, 2021, 7:52:00 AM2/2/21
to libplctag
I cannot add the Tag name as CommToInfeed[0].3 whereas when I change it to CommToInfeed[0] the status code 0 is returned. 

ms ns

unread,
Feb 2, 2021, 8:18:00 AM2/2/21
to libplctag
This is the output from the cmd 

2021-02-02 05:46:16.855 thread(1) tag(0) INFO plc_tag_create:578 Starting
2021-02-02 05:46:16.856 thread(1) tag(0) INFO initialize_modules:177 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO initialize_modules:186 Creating library mutex.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:633 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:660 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO initialize_modules:207 Initialized library modules.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO lib_init:130 Setting up global library data.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO lib_init:132 Creating tag hashtable.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO hashtable_create:75 Starting
2021-02-02 05:46:16.856 thread(1) tag(0) INFO hashtable_create:99 Done
2021-02-02 05:46:16.856 thread(1) tag(0) INFO lib_init:138 Creating tag hashtable mutex.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:633 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:660 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO lib_init:144 Creating tag tickler thread.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL thread_create:791 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL thread_create:825 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO lib_init:150 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO initialize_modules:210 Initializing AB module.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO ab_init:121 Initializing AB protocol library.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:633 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:660 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO ab_init:128 Finished initializing AB protocol library.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO initialize_modules:215 Initializing Modbus module.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO mb_init:1810 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mb_init:1812 Setting up mutex.
2021-02-02 05:46:16.856 thread(2) tag(0) INFO tag_tickler_func:197 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:633 Starting.
2021-02-02 05:46:16.856 thread(1) tag(0) DETAIL mutex_create:660 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO mb_init:1821 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO initialize_modules:226 Done initializing library modules.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO initialize_modules:231 Done.
2021-02-02 05:46:16.856 thread(1) tag(0) INFO find_tag_create_func:99 Matched protocol=ab-eip
2021-02-02 05:46:16.856 thread(1) tag(0) INFO ab_tag_create:165 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO rc_alloc_impl:111 Starting, called from ab_tag_create:172
2021-02-02 05:46:16.857 thread(1) tag(0) INFO rc_alloc_impl:130 Done
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL rc_alloc_impl:135 Returning memory pointer 0000021916ED3E40
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL ab_tag_create:178 tag=0000021916ED3E40
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL get_plc_type:910 Found ControlLogix/CompactLogix PLC.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL get_plc_type:910 Found ControlLogix/CompactLogix PLC.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_find_or_create:230 Starting
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_find_or_create:254 Creating new session.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO session_create_unsafe:446 Starting
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_create_unsafe:449 Session should use connected messaging.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO rc_alloc_impl:111 Starting, called from session_create_unsafe:454
2021-02-02 05:46:16.857 thread(1) tag(0) INFO rc_alloc_impl:130 Done
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL rc_alloc_impl:135 Returning memory pointer 0000021916ED4070
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_path:346 Starting
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL match_numeric_segment:468 Starting at position 0 in string 1,0.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL match_numeric_segment:495 Done.   Found numeric segment 1.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_path:362 Found numeric segment.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_path:358 Skipping separator character ','.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL match_numeric_segment:468 Starting at position 2 in string 1,0.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL match_numeric_segment:495 Done.   Found numeric segment 0.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_path:362 Found numeric segment.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_path:403 PLC needs connection, adding path to the router object.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_path:435 IOI size before 6
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_path:456 Done
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL add_session_unsafe:310 Starting
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL add_session_unsafe:320 Done
2021-02-02 05:46:16.857 thread(1) tag(0) INFO session_create_unsafe:553 Done
2021-02-02 05:46:16.857 thread(1) tag(0) INFO session_init:569 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL mutex_create:633 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL mutex_create:660 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL thread_create:791 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL thread_create:825 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO session_init:584 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_find_or_create:300 Done
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL ab_tag_create:266 using session=0000021916ED4070
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL get_tag_data_type:475 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL setup_tag_listing:2432 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO setup_tag_listing:2454 Tag is not a tag listing request.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL get_tag_data_type:665 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL ab_tag_create:332 Setting up Logix tag.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_symbolic_segment:912 Starting with name index=0 and encoded name index=1.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_symbolic_segment:951 Parsed symbolic segment "CommToInfeed" in tag name.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_numeric_segment:962 Starting with name index=13 and encoded name index=15.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_numeric_segment:1022 Parsed 1-byte numeric segment of value 0.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_numeric_segment:1025 Done with name index=14 and encoded name index=17.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_symbolic_segment:912 Starting with name index=16 and encoded name index=17.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_symbolic_segment:916 tag name at position 16 is not the start of a symbolic segment.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL parse_bit_segment:871 Starting with name index=16.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL cip_encode_tag_name:807 Found bit identifier 3.
2021-02-02 05:46:16.857 thread(3) tag(0) INFO session_handler:979 Starting thread for session 0000021916ED4070
2021-02-02 05:46:16.857 thread(1) tag(0) INFO tag_read_start:282 Starting
2021-02-02 05:46:16.857 thread(3) tag(0) DETAIL session_handler:998 in SESSION_OPEN_SOCKET state.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO build_read_request_connected:400 Starting.
2021-02-02 05:46:16.857 thread(3) tag(0) INFO session_open_socket:602 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_create_request:2334 Starting.
2021-02-02 05:46:16.857 thread(3) tag(0) DETAIL socket_create:1014 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO rc_alloc_impl:111 Starting, called from session_create_request:2343
2021-02-02 05:46:16.857 thread(1) tag(0) INFO rc_alloc_impl:130 Done
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL rc_alloc_impl:135 Returning memory pointer 0000021916ED5700
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_create_request:2357 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO session_add_request:912 Starting. sess=0000021916ED4070, req=0000021916ED5700
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_add_request_unsafe:877 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_add_request_unsafe:896 Total requests in the queue: 1
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL session_add_request_unsafe:898 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO session_add_request:918 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO build_read_request_connected:485 Done
2021-02-02 05:46:16.857 thread(1) tag(0) INFO tag_read_start:311 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO ab_tag_create:460 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL mutex_create:633 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL mutex_create:660 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL mutex_create:633 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) DETAIL mutex_create:660 Done.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO set_tag_byte_order:3253 Starting.
2021-02-02 05:46:16.857 thread(1) tag(0) INFO set_tag_byte_order:3554 Done.
2021-02-02 05:46:16.858 thread(3) tag(0) DETAIL socket_create:1033 Done.
2021-02-02 05:46:16.858 thread(3) tag(0) DETAIL session_open_socket:636 Using default port 44818.
2021-02-02 05:46:16.858 thread(3) tag(0) DETAIL socket_connect_tcp:1053 Starting.
2021-02-02 05:46:16.859 thread(3) tag(0) DETAIL socket_connect_tcp:1102 Found numeric IP address: 192.168.1.99
2021-02-02 05:46:16.861 thread(3) tag(0) DETAIL socket_connect_tcp:1194 Done.
2021-02-02 05:46:16.861 thread(3) tag(0) INFO session_open_socket:651 Done.
2021-02-02 05:46:16.861 thread(3) tag(0) DETAIL session_handler:1015 in SESSION_REGISTER state.
2021-02-02 05:46:16.861 thread(3) tag(0) INFO session_register:664 Starting.
2021-02-02 05:46:16.861 thread(3) tag(0) INFO send_eip_request:1763 Starting.
2021-02-02 05:46:16.861 thread(3) tag(0) INFO send_eip_request:1776 Sending packet of size 28
2021-02-02 05:46:16.861 thread(3) tag(0) INFO send_eip_request:1777  65 00 04 00 00 00 00 00 00 00
2021-02-02 05:46:16.861 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.861 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 01 00 00 00
2021-02-02 05:46:16.861 thread(3) tag(0) INFO send_eip_request:1811 Done.
2021-02-02 05:46:16.861 thread(3) tag(0) INFO recv_eip_response:1831 Starting.
2021-02-02 05:46:16.869 thread(3) tag(0) INFO recv_eip_response:1895 request received all needed data (28 bytes of 28).
2021-02-02 05:46:16.869 thread(3) tag(0) INFO recv_eip_response:1897  65 00 04 00 03 61 02 1a 00 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 01 00 00 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO recv_eip_response:1904 Done.
2021-02-02 05:46:16.869 thread(3) tag(0) INFO session_register:731 Done.
2021-02-02 05:46:16.869 thread(3) tag(0) DETAIL session_handler:1030 in SESSION_SEND_FORWARD_OPEN state.
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_forward_open_request:1942 Starting
2021-02-02 05:46:16.869 thread(3) tag(0) DETAIL send_forward_open_request:1952 Setting initial payload size guess to 4002.
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_extended_forward_open_request:2068 Starting
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1763 Starting.
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1776 Sending packet of size 92
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  6f 00 44 00 03 61 02 1a 00 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  00 00 2d 64 00 00 00 00 00 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  02 00 00 00 00 00 b2 00 34 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  5b 02 20 06 24 01 0a 05 00 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  00 00 53 4c 00 00 9d 1d 3d f3
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  45 43 50 21 01 00 00 00 40 42
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  0f 00 a2 0f 00 42 40 42 0f 00
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  a2 0f 00 42 a3 03 01 00 20 02
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1777  24 01
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_eip_request:1811 Done.
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_extended_forward_open_request:2127 Done
2021-02-02 05:46:16.869 thread(3) tag(0) INFO send_forward_open_request:1969 Done
2021-02-02 05:46:16.869 thread(3) tag(0) DETAIL session_handler:1036 Send Forward Open succeeded, going to SESSION_RECEIVE_FORWARD_OPEN state.
2021-02-02 05:46:16.869 thread(3) tag(0) DETAIL session_handler:1042 in SESSION_RECEIVE_FORWARD_OPEN state.
2021-02-02 05:46:16.869 thread(3) tag(0) INFO receive_forward_open_response:2140 Starting
2021-02-02 05:46:16.869 thread(3) tag(0) INFO recv_eip_response:1831 Starting.
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1895 request received all needed data (44 bytes of 44).
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1897  6f 00 14 00 03 61 02 1a 00 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1897  00 00 2d 64 00 00 00 00 00 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1897  02 00 00 00 00 00 b2 00 04 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1897  db 00 08 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1904 Done.
2021-02-02 05:46:16.875 thread(3) tag(0) WARN receive_forward_open_response:2164 Forward Open command failed, response code: Unsupported service. (8)
2021-02-02 05:46:16.875 thread(3) tag(0) WARN receive_forward_open_response:2167 Received CIP command unsupported error from the PLC!
2021-02-02 05:46:16.875 thread(3) tag(0) INFO receive_forward_open_response:2207 Done.
2021-02-02 05:46:16.875 thread(3) tag(0) DETAIL session_handler:1053 PLC does not support ForwardOpenEx, trying old ForwardOpen.
2021-02-02 05:46:16.875 thread(3) tag(0) DETAIL session_handler:1030 in SESSION_SEND_FORWARD_OPEN state.
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_forward_open_request:1942 Starting
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_old_forward_open_request:1981 Starting
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1763 Starting.
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1776 Sending packet of size 88
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  6f 00 40 00 03 61 02 1a 00 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  00 00 2e 64 00 00 00 00 00 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  02 00 00 00 00 00 b2 00 30 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  54 02 20 06 24 01 0a 05 00 00
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  00 00 53 4c 00 00 9e 1d 3d f3
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  45 43 50 21 01 00 00 00 40 42
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  0f 00 fc 43 40 42 0f 00 fc 43
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1777  a3 03 01 00 20 02 24 01
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_eip_request:1811 Done.
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_old_forward_open_request:2055 Done
2021-02-02 05:46:16.875 thread(3) tag(0) INFO send_forward_open_request:1969 Done
2021-02-02 05:46:16.875 thread(3) tag(0) DETAIL session_handler:1036 Send Forward Open succeeded, going to SESSION_RECEIVE_FORWARD_OPEN state.
2021-02-02 05:46:16.875 thread(3) tag(0) DETAIL session_handler:1042 in SESSION_RECEIVE_FORWARD_OPEN state.
2021-02-02 05:46:16.875 thread(3) tag(0) INFO receive_forward_open_response:2140 Starting
2021-02-02 05:46:16.875 thread(3) tag(0) INFO recv_eip_response:1831 Starting.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1895 request received all needed data (70 bytes of 70).
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1897  6f 00 2e 00 03 61 02 1a 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1897  00 00 2e 64 00 00 00 00 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1897  02 00 00 00 00 00 b2 00 1e 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1897  d4 00 00 00 01 b7 89 01 53 4c
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1897  00 00 9e 1d 3d f3 45 43 50 21
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1897  40 42 0f 00 40 42 0f 00 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1904 Done.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO receive_forward_open_response:2202 ForwardOpen succeeded with our connection ID 4c53 and the PLC connection ID 189b701 with packet size 508.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO receive_forward_open_response:2207 Done.
2021-02-02 05:46:16.897 thread(3) tag(0) DETAIL session_handler:1061 Send Forward Open succeeded, going to SESSION_IDLE state.
2021-02-02 05:46:16.897 thread(3) tag(0) DETAIL get_payload_size:1566 Starting.
2021-02-02 05:46:16.897 thread(3) tag(0) DETAIL get_payload_size:1580 Done.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO process_requests:1341 1 requests to process.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO pack_requests:1601 Starting.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO pack_requests:1611 Only one request, so done.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1703 Starting.
2021-02-02 05:46:16.897 thread(3) tag(0) DETAIL prepare_request:1732 cpf_targ_conn_id=189b701
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1740 Preparing connected packet with connection ID 4c53 and sequence ID 1(1)
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1747 Prepared packet of size 70
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1748  70 00 2e 00 03 61 02 1a 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1748  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1748  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1748  02 00 a1 00 04 00 01 b7 89 01
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1748  b1 00 1a 00 01 00 52 08 91 0c
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1748  43 6f 6d 6d 54 6f 49 6e 66 65
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1748  65 64 28 00 01 00 00 00 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO prepare_request:1750 Done.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1763 Starting.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1776 Sending packet of size 70
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1777  70 00 2e 00 03 61 02 1a 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1777  02 00 a1 00 04 00 01 b7 89 01
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1777  b1 00 1a 00 01 00 52 08 91 0c
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1777  43 6f 6d 6d 54 6f 49 6e 66 65
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1777  65 64 28 00 01 00 00 00 00 00
2021-02-02 05:46:16.897 thread(3) tag(0) INFO send_eip_request:1811 Done.
2021-02-02 05:46:16.897 thread(3) tag(0) INFO recv_eip_response:1831 Starting.
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1895 request received all needed data (56 bytes of 56).
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1897  70 00 20 00 03 61 02 1a 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1897  02 00 a1 00 04 00 53 4c 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1897  b1 00 0c 00 01 00 d2 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1897  c4 00 08 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO recv_eip_response:1904 Done.
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1445 Starting.
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1454 Got single response packet.  Copying 56 bytes unchanged.
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1543 Unpacked packet:
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1544  70 00 20 00 03 61 02 1a 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1544  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1544  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1544  02 00 a1 00 04 00 53 4c 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1544  b1 00 0c 00 01 00 d2 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) INFO unpack_response:1544  c4 00 08 00 00 00
2021-02-02 05:46:16.907 thread(3) tag(0) DETAIL unpack_response:1553 Done.
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL check_read_status_connected:1559 type byte = 196 (c4)
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL check_read_status_connected:1610 Increasing tag buffer size to 4 bytes.
2021-02-02 05:46:16.908 thread(1) tag(0) INFO check_read_status_connected:1620 Got 4 bytes of data
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL rc_dec_impl:242 Calling cleanup functions due to call at check_read_status_connected:1644 for 0000021916ED5700.
2021-02-02 05:46:16.908 thread(1) tag(0) INFO refcount_cleanup:256 Starting
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL request_destroy:2376 Starting.
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL request_destroy:2385 Done.
2021-02-02 05:46:16.908 thread(1) tag(0) INFO refcount_cleanup:268 Done.
2021-02-02 05:46:16.908 thread(1) tag(0) INFO plc_tag_create:744 tag set up elapsed time 51ms
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL add_tag_lookup:3657 Starting.
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL add_tag_lookup:3677 Found unused ID 11
2021-02-02 05:46:16.908 thread(1) tag(0) DETAIL add_tag_lookup:3697 Done.
2021-02-02 05:46:16.908 thread(1) tag(11) INFO plc_tag_create:762 Returning mapped tag ID 11
2021-02-02 05:46:16.908 thread(1) tag(11) INFO plc_tag_create:764 Done.
2021-02-02 05:46:16.908 thread(1) tag(11) INFO plc_tag_read:1162 Starting.
2021-02-02 05:46:16.908 thread(1) tag(11) INFO tag_read_start:282 Starting
2021-02-02 05:46:16.908 thread(1) tag(11) INFO build_read_request_connected:400 Starting.
2021-02-02 05:46:16.908 thread(1) tag(11) DETAIL session_create_request:2334 Starting.
2021-02-02 05:46:16.908 thread(1) tag(11) INFO rc_alloc_impl:111 Starting, called from session_create_request:2343
2021-02-02 05:46:16.908 thread(1) tag(11) INFO rc_alloc_impl:130 Done
2021-02-02 05:46:16.908 thread(1) tag(11) DETAIL rc_alloc_impl:135 Returning memory pointer 0000021916ED56A0
2021-02-02 05:46:16.908 thread(1) tag(11) DETAIL session_create_request:2357 Done.
2021-02-02 05:46:16.908 thread(1) tag(11) INFO session_add_request:912 Starting. sess=0000021916ED4070, req=0000021916ED56A0
2021-02-02 05:46:16.908 thread(1) tag(11) DETAIL session_add_request_unsafe:877 Starting.
2021-02-02 05:46:16.908 thread(1) tag(11) DETAIL session_add_request_unsafe:896 Total requests in the queue: 1
2021-02-02 05:46:16.908 thread(1) tag(11) DETAIL session_add_request_unsafe:898 Done.
2021-02-02 05:46:16.908 thread(1) tag(11) INFO session_add_request:918 Done.
2021-02-02 05:46:16.908 thread(1) tag(11) INFO build_read_request_connected:485 Done
2021-02-02 05:46:16.908 thread(1) tag(11) INFO tag_read_start:311 Done.
2021-02-02 05:46:16.909 thread(3) tag(0) DETAIL get_payload_size:1566 Starting.
2021-02-02 05:46:16.909 thread(3) tag(0) DETAIL get_payload_size:1580 Done.
2021-02-02 05:46:16.909 thread(3) tag(0) INFO process_requests:1341 1 requests to process.
2021-02-02 05:46:16.909 thread(3) tag(0) INFO pack_requests:1601 Starting.
2021-02-02 05:46:16.909 thread(3) tag(11) INFO pack_requests:1611 Only one request, so done.
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1703 Starting.
2021-02-02 05:46:16.909 thread(3) tag(0) DETAIL prepare_request:1732 cpf_targ_conn_id=189b701
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1740 Preparing connected packet with connection ID 4c53 and sequence ID 2(2)
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1747 Prepared packet of size 70
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1748  70 00 2e 00 03 61 02 1a 00 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1748  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1748  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1748  02 00 a1 00 04 00 01 b7 89 01
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1748  b1 00 1a 00 02 00 52 08 91 0c
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1748  43 6f 6d 6d 54 6f 49 6e 66 65
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1748  65 64 28 00 01 00 00 00 00 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO prepare_request:1750 Done.
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1763 Starting.
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1776 Sending packet of size 70
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1777  70 00 2e 00 03 61 02 1a 00 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1777  02 00 a1 00 04 00 01 b7 89 01
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1777  b1 00 1a 00 02 00 52 08 91 0c
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1777  43 6f 6d 6d 54 6f 49 6e 66 65
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1777  65 64 28 00 01 00 00 00 00 00
2021-02-02 05:46:16.909 thread(3) tag(0) INFO send_eip_request:1811 Done.
2021-02-02 05:46:16.909 thread(3) tag(0) INFO recv_eip_response:1831 Starting.
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1895 request received all needed data (56 bytes of 56).
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1897  70 00 20 00 03 61 02 1a 00 00
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1897  02 00 a1 00 04 00 53 4c 00 00
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1897  b1 00 0c 00 02 00 d2 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1897  c4 00 88 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(0) INFO recv_eip_response:1904 Done.
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1445 Starting.
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1454 Got single response packet.  Copying 56 bytes unchanged.
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1543 Unpacked packet:
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1544  70 00 20 00 03 61 02 1a 00 00
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1544  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1544  00 00 00 00 00 00 00 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1544  02 00 a1 00 04 00 53 4c 00 00
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1544  b1 00 0c 00 02 00 d2 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(11) INFO unpack_response:1544  c4 00 88 00 00 00
2021-02-02 05:46:16.917 thread(3) tag(11) DETAIL unpack_response:1553 Done.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL check_read_status_connected:1559 type byte = 196 (c4)
2021-02-02 05:46:16.919 thread(1) tag(11) INFO check_read_status_connected:1620 Got 4 bytes of data
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL rc_dec_impl:242 Calling cleanup functions due to call at check_read_status_connected:1644 for 0000021916ED56A0.
2021-02-02 05:46:16.919 thread(1) tag(11) INFO refcount_cleanup:256 Starting
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL request_destroy:2376 Starting.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL request_destroy:2385 Done.
2021-02-02 05:46:16.919 thread(1) tag(11) INFO refcount_cleanup:268 Done.
2021-02-02 05:46:16.919 thread(1) tag(11) INFO plc_tag_read:1277 elapsed time 11ms
2021-02-02 05:46:16.919 thread(1) tag(11) INFO plc_tag_read:1295 Done
2021-02-02 05:46:16.919 thread(1) tag(11) INFO plc_tag_destroy:1098 Starting.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL hashtable_remove:232 Starting
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL hashtable_remove:250 Done
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL plc_tag_destroy:1115 Aborting any in-flight operations.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL ab_tag_abort:734 Starting.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL ab_tag_abort:743 Called without a request in flight.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL ab_tag_abort:750 Done.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL rc_dec_impl:242 Calling cleanup functions due to call at plc_tag_destroy:1132 for 0000021916ED3E40.
2021-02-02 05:46:16.919 thread(1) tag(11) INFO refcount_cleanup:256 Starting
2021-02-02 05:46:16.919 thread(1) tag(11) INFO ab_tag_destroy:802 Starting.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL ab_tag_destroy:814 Getting ready to release tag session 0000021916ED4070
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL ab_tag_destroy:816 Removing tag from session.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL rc_dec_impl:242 Calling cleanup functions due to call at ab_tag_destroy:817 for 0000021916ED4070.
2021-02-02 05:46:16.919 thread(1) tag(11) INFO refcount_cleanup:256 Starting
2021-02-02 05:46:16.919 thread(1) tag(11) INFO session_destroy:773 Starting.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL remove_session:371 Starting.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL remove_session_unsafe:347 Starting
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL remove_session_unsafe:362 Done
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL remove_session:379 Done.
2021-02-02 05:46:16.919 thread(1) tag(11) INFO session_destroy:784 Session sent 5 packets.
2021-02-02 05:46:16.919 thread(1) tag(11) DETAIL session_destroy:790 Destroying session thread.
2021-02-02 05:46:16.921 thread(1) tag(11) INFO perform_forward_close:1915 Starting.
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_forward_close_req:2219 Starting
2021-02-02 05:46:16.921 thread(1) tag(11) DETAIL send_forward_close_req:2231 Forward Close connection path:
2021-02-02 05:46:16.921 thread(1) tag(11) DETAIL send_forward_close_req:2232  01 00 20 02 24 01
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1763 Starting.
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1776 Sending packet of size 64
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1777  6f 00 28 00 03 61 02 1a 00 00
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1777  00 00 2f 64 00 00 00 00 00 00
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1777  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1777  02 00 00 00 00 00 b2 00 18 00
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1777  4e 02 20 06 24 01 0a 05 9e 1d
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1777  3d f3 45 43 50 21 03 00 01 00
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1777  20 02 24 01
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_eip_request:1811 Done.
2021-02-02 05:46:16.921 thread(1) tag(11) INFO send_forward_close_req:2271 Done
2021-02-02 05:46:16.921 thread(1) tag(11) INFO recv_forward_close_resp:2282 Starting
2021-02-02 05:46:16.921 thread(1) tag(11) INFO recv_eip_response:1831 Starting.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1895 request received all needed data (54 bytes of 54).
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1897  6f 00 1e 00 03 61 02 1a 00 00
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1897  00 00 2f 64 00 00 00 00 00 00
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1897  00 00 00 00 00 00 00 00 01 00
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1897  02 00 00 00 00 00 b2 00 0e 00
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1897  ce 00 00 00 9e 1d 3d f3 45 43
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1897  50 21 00 00
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_eip_response:1904 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_forward_close_resp:2311 Connection close succeeded.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO recv_forward_close_resp:2316 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO perform_forward_close:1931 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO session_unregister:741 Starting.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO session_unregister:745 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO session_close_socket:754 Starting.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO session_close_socket:762 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL session_destroy:838 Destroying session mutex.
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL mutex_destroy:748 destroying mutex 0000021916ED50D8
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL mutex_destroy:761 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL session_destroy:844 Cleaning up allocated memory for paths and host name.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO session_destroy:860 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO refcount_cleanup:268 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL mutex_destroy:748 destroying mutex 0000021916ED3E68
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL mutex_destroy:761 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL mutex_destroy:748 destroying mutex 0000021916ED3E70
2021-02-02 05:46:16.937 thread(1) tag(11) DETAIL mutex_destroy:761 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO ab_tag_destroy:843 Finished releasing all tag resources.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO ab_tag_destroy:845 done
2021-02-02 05:46:16.937 thread(1) tag(11) INFO refcount_cleanup:268 Done.
2021-02-02 05:46:16.937 thread(1) tag(11) INFO plc_tag_destroy:1134 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO ab_teardown:138 Releasing global AB protocol resources.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO ab_teardown:140 Terminating IO thread.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO ab_teardown:148 Freeing session information.
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:748 destroying mutex 00007FFAF1417650
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:761 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO ab_teardown:154 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO mb_teardown:1791 Starting.
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mb_teardown:1795 Destroying Modbus mutex.
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:748 destroying mutex 00007FFAF1417668
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:761 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO mb_teardown:1801 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO lib_teardown:160 Tearing down library.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO lib_teardown:165 Tearing down tag tickler thread.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO lib_teardown:172 Tearing down tag lookup mutex.
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:748 destroying mutex 00007FFAF1417628
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:761 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO lib_teardown:178 Destroying tag hashtable.
2021-02-02 05:46:16.937 thread(1) tag(0) INFO hashtable_destroy:260 Starting
2021-02-02 05:46:16.937 thread(1) tag(0) INFO hashtable_destroy:272 Done
2021-02-02 05:46:16.937 thread(1) tag(0) INFO lib_teardown:185 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:748 destroying mutex 00007FFAF1417618
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL mutex_destroy:761 Done.
2021-02-02 05:46:16.937 thread(1) tag(0) DETAIL plc_tag_unregister_logger:945 Starting
2021-02-02 05:46:16.938 thread(1) tag(0) DETAIL plc_tag_unregister_logger:949 Done.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO ab_teardown:138 Releasing global AB protocol resources.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO ab_teardown:140 Terminating IO thread.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO ab_teardown:148 Freeing session information.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO ab_teardown:154 Done.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO mb_teardown:1791 Starting.
2021-02-02 05:46:16.938 thread(1) tag(0) DETAIL mb_teardown:1795 Destroying Modbus mutex.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO mb_teardown:1801 Done.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO lib_teardown:160 Tearing down library.
2021-02-02 05:46:16.938 thread(1) tag(0) INFO lib_teardown:185 Done.
2021-02-02 05:46:16.938 thread(1) tag(0) DETAIL plc_tag_unregister_logger:945 Starting
2021-02-02 05:46:16.938 thread(1) tag(0) DETAIL plc_tag_unregister_logger:949 Done.
Library version 2.2.0.
Arg[0]=tag_rw.exe
Arg[1]=-t
Arg[2]=bit
Arg[3]=-p
Arg[4]=protocol=ab-eip&gateway=192.168.1.99&path=1,0&plc=ControlLogix&name=CommToInfeed[0].3
Arg[5]=-d
Arg[6]=4
data=1
Done
 

But when I access the tag CommToInfeed[0].3 from code it returen -4 error status code.

ms ns

unread,
Feb 3, 2021, 3:16:09 AM2/3/21
to libplctag
Hi Kyle,

Any idea why am I getting this error code while trying to write on a bit of an array?. Any help would be appreciated.

--
You received this message because you are subscribed to a topic in the Google Groups "libplctag" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/libplctag/mW8oEkYY5r0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to libplctag+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libplctag/90165bdd-44b7-4847-b295-38bbbf29dd32n%40googlegroups.com.

Kyle

unread,
Feb 3, 2021, 9:34:32 PM2/3/21
to libplctag

It looks like the wrapper may not have a recent version of the C DLL.   What wrapper are you using?  This would be the C# library.   Are you using the one from the libplctag GitHub organization? 

Please make sure you use the latest version from https://github.com/libplctag/libplctag.NET.   That contains the latest version of the C library.   Note that you may need to use the low level code to access the bit functions to get and set single bits.

Best,
Kyle

ms ns

unread,
Feb 4, 2021, 4:49:13 AM2/4/21
to libplctag
What exactly do you mean by low level code?

ms ns

unread,
Feb 4, 2021, 5:31:36 AM2/4/21
to libplctag
I used that code as well but same exception of error bad param. 

ms ns

unread,
Feb 4, 2021, 5:33:08 AM2/4/21
to libplctag
What should I do now. 

tim...@gmail.com

unread,
Feb 4, 2021, 6:28:46 AM2/4/21
to libplctag
Get it working by reading/writing the whole DINT first, and code up some Bit Masking to access individual bits. https://www.arduino.cc/en/Tutorial/Foundations/BitMask

To access as a DINT. For the tagname, use CommFromPalletizer or CommFromPalletizer[0], not CommFromPalletizer[0].3

For further reading, there are many examples for you to study:

When Kyle said "low-level code", I believe he is referring to using the C API methods (specifically the bit handling methods), rather than higher-level methods.


Kyle

unread,
Feb 4, 2021, 10:41:55 PM2/4/21
to libplctag
I did some experimentation.   This is with the C DLL methods.  

I accessed the tag TestDINTArray[0].8.   But I treated it like I was accessing a full DINT.   I did not use any of the bit methods.   I just kept reading it and writing it as if it was a full DINT.   I got only the values 0 and 1 as expected.  And I can write it using full DINT values, but only that one bit changes.   So if I write 0, the bit becomes 0.  If I write any non-zero value, the bit becomes 1.   The bit tag internal flag is "sticky" in that it keeps working even if you use the other integer data accessors.  Once you tell the C DLL that you are dealing with a single bit, it will remember that and only change that bit.

You can tell the wrapper code that you are accessing a DINT and you will only get the values 0 and 1 back depending on the value of that single bit.

Please follow what Tim said first: get it reading and writing a full DINT.   Then you should be able to just add the ".3" to get the tag name "CommToInfeed[0].3".

Without a debug log from the code, I cannot tell why there is an error.   Is the wrapper doing some parsing of the tag name?

Best,
Kyle

ms ns

unread,
Feb 9, 2021, 4:51:30 AM2/9/21
to libplctag
I have successfully read and write to the bit of index array. What I did was create a batch file and executed the cmd commands. It really worked like a charm. 

ms ns

unread,
Feb 9, 2021, 4:52:14 AM2/9/21
to libplctag
But kyle what would be the cmd command for the bool tag. How can we read and write it through cmd? 

On Friday, 5 February 2021 at 08:41:55 UTC+5 Kyle wrote:

Kyle

unread,
Feb 9, 2021, 10:26:17 AM2/9/21
to libplctag
I do not understand the question.   Are you trying to use the library with a batch file running tag_rw or are you trying to write code in C# to do this?   Can you please explain?  In order to help you it is important that we learn:

  • what platform you are using: Windows, MacOS, Linux...
  • The version of the C DLL you are using.
  • what language you are programming in, C, C++, C#.   And what version of the wrapper, if any.
  • The tag name and type.
  • The type of PLC.
  • Example code that shows what you are trying to do.
With these things we can try to help more.   Without them, we are not able to give you and pointers.

Best,
Kyle

ms ns

unread,
Feb 9, 2021, 10:33:13 AM2/9/21
to Kyle, libplctag
I basically needed to write on to a tag. So I created a batch file with cmd tag_rw command in it and executed in the code. It worked as well. I am using the C# library and once I am done with the whole work I will post my code and logic as well.

But there's one thing that I needed to ask..how can we read/write boolean data type tag in plc?

You received this message because you are subscribed to the Google Groups "libplctag" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libplctag+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libplctag/e15d68a0-42b8-428c-ad72-7860b835a488n%40googlegroups.com.

Kyle

unread,
Feb 9, 2021, 10:25:07 PM2/9/21
to libplctag
If you want to write a boolean type (not a single bit) you can just reference the tag name.   You will get back a single byte with 1 or 0 in it.  You can write it as well by using the uint8 data setter.  If you have a boolean tag, myHappyLittleBool, you just use that as the name.   If you need to provide a data type, use a byte or uint8.

If you want to access a boolean array, you will get back an array of DINT of the total number of bools in the array divided by 32, rounded up to the nearest multiple of 32.   Rockwell packs boolean arrays like this.   It is a pain to access these because you need to treat them as DINTs and either use bit tags or use masks in your code to set the bits you want.  

If you want to access a single bit in an integer type, you add the ".<bit#>" notation at the end of your tag name as you did in the examples from before.  These are bit tags.

I hope that helps!

Best,
Kyle


ms ns

unread,
Feb 10, 2021, 2:40:23 AM2/10/21
to libplctag
tag_rw -t byte  -p "protocol=ab-eip&gateway=192.168.1.99&path=1,0&plc=ControlLogix&elem_size=1&elem_count=1&name=TagName" -d 4 > log.txt 2>&1

byte data type is not a valid one. Used the uint8...so it returns data[0]=255 (ff) which means the tag value holds 1?  

ms ns

unread,
Feb 10, 2021, 2:40:54 AM2/10/21
to libplctag
I have a single tag to access to not an array this time.

On Wednesday, 10 February 2021 at 08:25:07 UTC+5 Kyle wrote:

Kyle Hayes

unread,
Feb 11, 2021, 12:34:58 AM2/11/21
to ms ns, libplctag
You can use bool type if the wrapper supports it.  You just access the tag with its name.   You do not need the special bit format.   In that case, you should write 0 for false and 0xFF for true.

Best,
Kyle

Reply all
Reply to author
Forward
0 new messages