Sign in to follow this  
Followers 0
MickeyBob

HostLink MM, QQMR, & QQIR Commands

11 posts in this topic

I'm implementing a serial HostLink protocol in the open source language Python and have completed just about everything but the MM, QQMR, and QQIR commands. I don't really have a good understanding of what these commands do, what they are used for, and how to use them. Can anyone help me understand these better. Any help will be greatly appreciated. Thanks, MickeyBob P.S. If any one is interested in beta testing my implementation, please let me know.

Share this post


Link to post
Share on other sites
Do you have a hostlink reference? If so, I will just describe in general. If not, we'll look them up in detail. MM is known as the model read command. It basically returns the model of the PLC, the amount of RAM and other descriptive details about the PLC. The QQMR command is known as the "laundry list" command. It basically lets you request non-consecutive and non-similar areas of memory in the order that you would like to see them return. The QQIR returns the current "laundry list" without having to list them seperately. It will continue to return the same list until a new QQMR command is issued. Think about the watch window of CX Programmer. This is a good example for the use of QQMR and QQIR commands.

Share this post


Link to post
Share on other sites
I had a case of fat fingers or a brain burp (more likely). I meant the MI command instead of the MM command. I have both a hard copy and an electronic copy of the communications manual that I have been referencing but was having trouble putting these particular commands into prospective. I really wasn't sure what a "registered I/O table" meant. Your explanation helped a lot. So if my understanding is correct, I would need to issue the QQMR command to "preregister" the I/O table, the MI command to "correct" or "generate" the I/O table (i.e., have the CPU populate the I/O table with actual values), and then the QQIR command to read the I/O values. To get updates on the same data at a later time, all I would need to do is issue the MI and QQIR commands. Is this correct? Thanks for the help!

Share this post


Link to post
Share on other sites
Whoa!...... MI is the command to write the I/O table, yes.... but it is not documented. I will try to find some detail about it. It is pretty complicated and requires a lot of pre-knowledge about the PLC model before configuring the command. With regards to QQMR and QQIR, please reread the above and think about it with reference to all the memory area read commands you have already mastered. This is for reading a specified list of IR,HR,SR,AR and TC values, not I/O table.

Share this post


Link to post
Share on other sites
Maybe, I'm confusing you with the term "I/O table". I'm using it in the same sense (I think) as the reference manual, that is, a collection of registers (DM, TIM, EM, IR, etc) that is registered with the CPU using the QQMR command. (which seems to me to be consistent with your last comment) Then, when the QQIR command is issued, the CPU returns the values of the "registered" registers in a comma separated format. I suspect you're thinking of the "I/O table" as the actual PLC I/O configuration table...maybe? Am I understanding this correctly or am I in left-field? Thanks

Share this post


Link to post
Share on other sites
Here some more info... I've gotten the QQMR and QQIR commands to work, sorta. I can properly register and read individual bits. For example, the command "@00QQMRHR 000000,HR 000001" registers H0.0 and H0.1. Then when I execute "@00QQIR", the current values are returned as "0,1", assuming that H0.0 is reset and H0.1 is set. However, I haven't figured out how to read word data yet. The format of the QQMR command as shown on page 95 of W342-E1-1 makes reference to the "word data designation" (just below the first line of the command format). I don't understand from this reference how to register a whole word. I also haven't figured out how to read timer/counter PVs and SVs. I have found out from experimentation that I can specify up to 3 bits for a timer/counter (i.e., "@QQMRTIM 000000,TIM 000001,TIM 000002" returns "0,0,0") but don't know to what these map. Trying to read a fourth bit generates a error code 14. Thanks again.

Share this post


Link to post
Share on other sites
Here's the page from the communications manual I was talking about...

Share this post


Link to post
Share on other sites
Ok, I think I have a little better handle on the QQMR and QQIR commands. I'll try to lay it out without confusing me and you When specifying items for the registered I/O table, you specify the area (e.g., HR, WR, DM, etc.), the word address (e.g., 0-9999 for DM), and a bit. For a typical register (all registers except a timer or counter), you can specify a bit from 00 to 15 as you would expect. You can also specify a bit of "CH", which, I surmise, stands for "channel". In this case, the word value is registered (e.g., "@00QQMRDM 0000CH" registers the word value of DM0000). If you use the QQIR command to read a bit, it comes back as a '1' or '0'. If you read a word, it comes back in four hexadecimal digits. But, timers and counters are different. You can specify any two digit number for the bit. No matter what bit you specify, it registers the status bit of the timer/counter. If you specify a bit of "CH" for a timer or counter, both the PV and status bit of the timer/counter are registered (e.g., "@00QQMRTIM 0000CH" registers both the status bit and PV for T0). If you use the QQIR command to read a timer/count "CH" bit, you get back 5 hexadecimal digits. The first digit is either '1' or '0' and corresponds to the timer/counter's status bit. The remaining four digits are the PV word value. Hope I didn't muddy the water further...
1 person likes this

Share this post


Link to post
Share on other sites
You did a good job of figuring it out on your own! I'm confused, though, do you still have a question?

Share this post


Link to post
Share on other sites
I guess at this point the only question I have is with regard to the MI command. It sounds like this command really isn't necessary for reading/writing registers. At this point, learning more about the MI command would only satisfy my personal curiosity. If you have found some more information on it, I would like to look at it. Thanks for the help and for being a sounding board!

Share this post


Link to post
Share on other sites
Still on the road! I will research it this weekend.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0