PASHA Change Groups
Even with today's high-speed and nearly ubiquitous 100BaseTX network connections, RS-232 is still a very capable method of control with its relatively simple commands with no MAC addresses, IP addresses and subnets etc. While we do offer TCP/IP control of MWare with the RATC (Remote Access Telnet Command) service within MWare, a lot of people prefer the old warhorse RS-232 because of its relative simplicity.
PASHA is what we call the RS-232 protocol in MWare and it comes with many useful commands. However, one complaint has been that there was no easy way to keep track of multiple control values without sending multiple Get commands ("Gxxx.") and then parsing the results. This is because MWare does not "volunteer" information. You must poll for values. RATC solved this problem with its Change Groups, meaning that you can set up a list of controls that you want to monitor. When polled, a list of only the controls that have changed on the list are returned. This means that one command to poll results in a short or long list of values, depending on the number of changed controls.
Now Change Groups are available with PASHA (but are separate from any RATC Change Groups you may have. It is covered in a separate topic because it can add unnecessary complexity to those new to serial control of MWare. Please read and understand the PASHA topic before embarking upon this new adventure in serial coding.
The PASHA Change Groups Protocol (as simple as possible)
The GetChanges command is of the form: "Knnnn.", where nnnn is a 4-digit hex number indicating the maximum number of changes to return. The value can be 0000 through 7FFF. The MSB (most significant bit), which is 8000 hex for a 4-digit number, can be set for a special meaning explained later.
The first part of the response is of the form: "Lnnnn.", where nnnn is a 4-digit hex number indicating the actual number of parameter values that follow in the second part of the response.
The 0 to nnnn parameter values that follow are each of the form: "Jppppxxxx.", where pppp is a 4-character Control Group name and xxxx is a 4-digit hex parameter value indicating a positional value between 0000 and 7FFF (providing the highest resolution of the control (0 - 32767)). If the control has two states (like a mute button or status LED), then you will get values representing 0 or 32767 (0000 or 7FFF) in the responses. For a control with less than 32767 positions, like a router, there are predictable ranges, just as there are in the Value Table.
The first GetChanges command since the service was enabled on the COM port will cause a parameter change group to be created for that COM port that has as members all Control Groups with 4 character names that have as their first character an a-z or A-Z (not a decimal digit). When a parameter change group is created, it is primed to return the current value for every member of the group.
A GetChanges command which has the MSB set in the "number of changes to return" value (example: "K800A.") causes a reset of the change group, which results in the change group being primed to return the current value for every member of the group, just like at startup. The maximum number of changes returned will be the number minus 0x8000. This should be performed by the control application when it starts up so that it can sync up to all the parameter values.
Note: The limitations on serial receive buffering present in some control system products can be encountered easily by asking for too many changes at a time. So, for a PASHA client that can only buffer 10 changes at a time (including the "Lnnnn." first part of the response), that client should, on startup, issue a "K800A." to invalidate the change group and get up to 10 responses, and then it should periodically poll with a "K000A.".
Note: Only the 4-character Control Groups beginning with a letter (A-Z and a-z) will be put into each PASHA client change group, something the view file designer should take into account.
Example
The following is an example of a simple scenario in sending and receiving PASHA Change Group commands. We know that this isn't the easiest topic to grasp, so hopefully, this will help illustrate the concept for you.
Command\s sent to a PASHA port are in Blue and responses from PASHA are in Red. Comments are in Green. Actions from within MWare or RAMM are in Purple.
Control Groups:
Levl
(A -100 to +12 Level control)
Pre1
(SubPreset 1's Loaded LED)
Pre2
(SubPreset 2's Loaded LED)
Sig1
(Signal Present LED)
Values Before Start of PASHA:
Levl
= +4.64dB (26734 or 686eh
[Hex])
Pre1
= Off (0 or 0000h)
Pre2
= On (32767 or 7FFFh)
Clp1
= Off (0 or 0000h)
Start of PASHA:
K000A.
Change
Group Request (first time)
L0004. Returns
total number of changes to follow (first time means all are sent)
JLevl686A. For
Control Group Levl, the value is 686E (26734 of 32767 = +4.64)
JPre10000. For
Control Group Pre1, the value is 0000 (0 of 32767 = Off)
JPre27FFF. For
Control Group Pre2, the value is 7FFF (32767 of 32767 = On)
JClp10000. For
Control Group Clp1, the value is 0000 (0 of 32767 = Off)
Level is moved to +11.7dB in MWare
SubPreset 1 is Loaded from RAMM
K000A. Change
Group Request
L0003. Returns
that there are 3 values to follow
JLev17F05. For
Control Group Levl, the value is 7F05 (32517 of 32767 = +11.7)
JPre17FFF. For
Control Group Pre1, the value is 7FFF (32767 of 32767 = On)
JPre20000. For
Control Group Pre2, the value is 0000 (0 of 32767 = Off)
Music starts and gets loud enough to light the Clip LED
K000A. Change
Group Request
L0001. Returns
that there is 1 value to follow
JClp17FFF. For
Control Group Clp1, the value is 7FFF (32767 of 32767 = On)
and so on...
This should begin to illustrate the concept enough to get you started. Remember in your controller code that you should send a reset request (Change Group Request with 8 as the MSB (e.g. K800A.)) to prime all qualified Control Groups to be returned. This Reset, should be used when your controller resets to extract all current values from MWare. Subsequent requests should only call for changes since the first reset call.
The PASHA Change Group Monitor allows you to monitor a Control Group's level in decimal from within MWare. Simply Control Group the purple text blocks to the control(s) you want to monitor. The White blocks will accept your description in Control Mode (don't Control Group them!). Use the Windows Calculator program in Scientific mode to quickly convert this decimal value to hexadecimal.
Related Topic