Jump to content
C4 Forums | Control4
  • 0

How to use "LEVEL" Parameter in Driverworks Wizard


YourMe

Question

Hi guys,

I am trying to build serial driver for AVR, all going fine except for the volume has no UP and Down command.

 

Setting each level has to be discrete like VOL01, VOL02, VOL03....VOL99, VOL100

How can I use the LEVEL parameter around my command to trigger next volume setting in the wizard. (See pic attached).. 

 

Thanks in advance

9ba8a789-51fc-4bf5-83f3-0051b2193cfb.jpeg

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • 0
5 hours ago, Crustyloafer said:

It would be most unusual for there not to be a command for Vol +1 and Vol -1 available.  What make/model of AVR is it?

Hi, it has not vol up and down commands as seen in the protocol manual... it is monoprice multiroom controller 

Check 

https://downloads.monoprice.com/files/manuals/10761_Manual_131209.pdf

 

 

So is the use of parameter "LEVEL" possible  ?

 

Link to comment
Share on other sites

  • 0

Those instruction are not the clearest to decipher, but it looks like the command structure is as follows:

<xxPPuuCR

xx stands for control object - I assume this is the zone or group of zones you wish to control so would be 10 for all zones, 11 for Zone 1, 12 for Zone 2 etc.

PP stands for control action code - this will be the command type you wish to send to the zone referred to by 'xx'

uu will be the units you wish to adjust whatever you are controlling the action code specified by 'PP'

CR is just the carriage return needed to be added at the end of every command line in order for it to be accepted and actioned. In ASCII format this is entered as \r.

 

For volume control, there are two listings, one just says VO for volume control and the other says VO (00-38) for volume control. This also suggest there are two command types which can be sent, either increase of decrease command such as +1 or -1 or a numerical figure from 00-38, suggesting there are only 38 volume steps available.

 

For example, I think the volume up and down commands for Unit 1 and Zone 1 are likely to be: <11VO+1\r and <11VO-1\r

To go to a specific level you would send <11VO25\r or <11VO12\r etc.

 

Here is an excerpt from the 'Guidelines for Entering Serial Codes' from the Control Dealer Portal Knowledgebase. If you are a dealer then go and check out KB article 710.

 

All serial data in the end becomes bytes. There are three basic formats to represent bytes, but in the end the resulting data is just bytes, and any format would suffice for the entry. For ease-of-use, multiple formats are supported.
Examples for all methods: Data is equivalent to the ASCII string “DVD” with a carriage return at the endDecimal Data — With decimal data and between any of the different formats there must be a space to act as a delimiter between different pieces of data. To enter decimal data, enter the value to be stored in the byte in decimal. Valid data is from 0-255.

 Example Data (“DVD” with carriage return): 68 86 68 13

Hexadecimal Data — With hexadecimal data and between any of the different formats, there must be a space to act as a delimiter between different pieces of data. To enter hexadecimal data, enter the ‘$’ symbol immediately followed by the value to be stored in the byte in hexadecimal. Valid data is from $00-$FF.

 Example Data (“DVD” with carriage return): $44 $56 $44 $0D

ASCII Data — All ASCII data must be inside double quotes. Each byte inside the quotes represents one byte of data. Look at any ASCII table to see the real values each character represents. The same ASCII characters supported in the C programming language are supported. Escape characters are also supported in the same way. Supported characters include \n (new line), \r (return), \t (tab, and \” (double quotes).

  Example Data (“DVD” with carriage return):

  “DVD\r”

Link to comment
Share on other sites

  • 0
7 hours ago, Crustyloafer said:

Those instruction are not the clearest to decipher, but it looks like the command structure is as follows:

<xxPPuuCR

xx stands for control object - I assume this is the zone or group of zones you wish to control so would be 10 for all zones, 11 for Zone 1, 12 for Zone 2 etc.

PP stands for control action code - this will be the command type you wish to send to the zone referred to by 'xx'

uu will be the units you wish to adjust whatever you are controlling the action code specified by 'PP'

CR is just the carriage return needed to be added at the end of every command line in order for it to be accepted and actioned. In ASCII format this is entered as \r.

 

For volume control, there are two listings, one just says VO for volume control and the other says VO (00-38) for volume control. This also suggest there are two command types which can be sent, either increase of decrease command such as +1 or -1 or a numerical figure from 00-38, suggesting there are only 38 volume steps available.

 

For example, I think the volume up and down commands for Unit 1 and Zone 1 are likely to be: <11VO+1\r and <11VO-1\r

To go to a specific level you would send <11VO25\r or <11VO12\r etc.

 

Here is an excerpt from the 'Guidelines for Entering Serial Codes' from the Control Dealer Portal Knowledgebase. If you are a dealer then go and check out KB article 710.

 

All serial data in the end becomes bytes. There are three basic formats to represent bytes, but in the end the resulting data is just bytes, and any format would suffice for the entry. For ease-of-use, multiple formats are supported.
Examples for all methods: Data is equivalent to the ASCII string “DVD” with a carriage return at the endDecimal Data — With decimal data and between any of the different formats there must be a space to act as a delimiter between different pieces of data. To enter decimal data, enter the value to be stored in the byte in decimal. Valid data is from 0-255.

 Example Data (“DVD” with carriage return): 68 86 68 13

Hexadecimal Data — With hexadecimal data and between any of the different formats, there must be a space to act as a delimiter between different pieces of data. To enter hexadecimal data, enter the ‘$’ symbol immediately followed by the value to be stored in the byte in hexadecimal. Valid data is from $00-$FF.

 Example Data (“DVD” with carriage return): $44 $56 $44 $0D

ASCII Data — All ASCII data must be inside double quotes. Each byte inside the quotes represents one byte of data. Look at any ASCII table to see the real values each character represents. The same ASCII characters supported in the C programming language are supported. Escape characters are also supported in the same way. Supported characters include \n (new line), \r (return), \t (tab, and \” (double quotes).

  Example Data (“DVD” with carriage return):

  “DVD\r”

Thank You so much but not working for volume... 

I must tell you am familiar with the protocol, I have built module in Crestron and even develop android app using global cache and I can tell you I kind of use variables in all above to hold, increase and decrease volume of each zone... VOL+1 and VOL-1 is not working  as you suggest (see picture attached) and I dont think they have direct commands for volume up and down.

Only setting of volume value works which what I want to figure out in Control4...

How do I capture the volume parameter "LEVEL" so as to increase it then pass it to the command for volume up and down...

Appreciate your help further

20190414_150217.jpg

Link to comment
Share on other sites

  • 0

That’s a pretty poor set of control commands then if it doesn’t allow a simple increase or decrease in volume. 

I guess you could create a variable called Volume and then program the volume buttons to increase or decrease that variable. Then program against that variable changing to set the volume value to equal the current variable value.  

Link to comment
Share on other sites

  • 0
8 hours ago, Crustyloafer said:

That’s a pretty poor set of control commands then if it doesn’t allow a simple increase or decrease in volume. 

I guess you could create a variable called Volume and then program the volume buttons to increase or decrease that variable. Then program against that variable changing to set the volume value to equal the current variable value.  

Thanks for your help, was able to make all 38 values of volume work via Programming > Device Event by setting condition to run command which emit serial code of each value.

NEW ISSUE BELOW !

Another weird thing happening is from Control4 App, my volume just jump to 100% on pressing either volume up or down... see attached

Any idea why this is so ?Screenshot_20190415-011956_Control4.thumb.jpg.319150bb350052ebfb883a9fee59231d.jpg

Link to comment
Share on other sites

  • 0
1 hour ago, lippavisual said:

Driverworks is 1-way control only, therefore, that's why you are seeing 100% for volume.  It can also be displayed as 0%, but same reasoning.

Thank you, Trying to build 2 way with DriverEditor... any straight way ?

Link to comment
Share on other sites

  • 0

 

Quote

How can I use the LEVEL parameter around my command to trigger next volume setting in the wizard.

@YourMe - to answer your original question, I believe the syntax to use the LEVEL parameter in driverworks wizard to adjust the Zone 5 volume is "<15VO %2EDLEVEL \r"
where the % indicates a paramater will be used
The 2 indicates how many digits (leading zeroes added)
E (or e) indicates Big Endian or Small endian
D indicates Decimal

I am creating a driver for the same Monoprice 10761 6x6 audio matrix.  I have most of the commands working for powering and switching zones, but I think the LEVEL being passed for the volume is currently in percent (0-100) rather than 0-38 as I am getting deafened. 🙂

Link to comment
Share on other sites

  • 0

I've been doing some more work to try and get the level scaled correctly from percent (0-100) in the OUTPUT_nn_VOLUME_LEVEL variable to a 0-38 range that the matrix expects, but from looking through the logs, I don't think the driver is even using the LEVEL parameter at all.  I can see the logs show that only <11VO is being sent, instead of <11VO30\r in the example below where the volume for amp 1 zone 1 should be set to 30.
The LEVEL parameter is correctly getting the value of 30 in the xml, but this is not being transformed into the Serial packet being sent to the device.
 

2022-04-25 16:21:21.981 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: Incoming request [endpoint: 192.168.70.50:58996][request: SendToDeviceAsync]: <c4soap name="SendToDeviceAsync" session="0" operation="RWX" category="composer" async="True"><param name="iddevice" type="number">1442</param><param name="data" type="string"><devicecommand owneridtype="" owneriditem="-1"><command>SET_VOLUME_LEVEL</command><params><param><name>LEVEL</name><value type="INTEGER">\x0a<static>30</static></value>\x0a</param>\x0a<param><name>OUTPUT</name><value type="INTEGER">\x0a<static>4000</static></value>\x0a</param>\x0a</params></devicecommand></param></c4soap>\x00
2022-04-25 16:21:21.982 +1200 ea5-000FFF98EC5D [5427] (5427) INFO: Executing command (SET_VOLUME_LEVEL) on driver MonoPrice-Barry(1442)
2022-04-25 16:21:21.982 +1200 ea5-000FFF98EC5D [5427] (5427) DEBUG:   xml = <devicecommand><command>SET_VOLUME_LEVEL</command><params><param><name>LEVEL</name><value type="INTEGER"><static>30</static></value></param><param><name>OUTPUT</name><value type="INTEGER"><static>4000</static></value></param></params></devicecommand>
2022-04-25 16:21:21.982 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: BoundCall: [command: PROTOCOL_COMMAND][notify: ]
2022-04-25 16:21:21.983 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: BoundCall: [command: SEND][notify: ]
2022-04-25 16:21:21.984 +1200 ea5-000FFF98EC5D [5427] (5427) DEBUG: Sending payload [device id: 15][name: Control4 EA-5][size: 8]
2022-04-25 16:21:21.984 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: asyncWriteImpl(): Writing payload [127.0.0.1:5102][size: 8]
2022-04-25 16:21:21.985 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: CTimerBacon::AddTimer(): [id: 11397291][start time: 1142061720931311 nanoseconds][duration: 100][repeat: false][class: av_gen][total timers: 851]
2022-04-25 16:21:21.985 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: C4BaseDriver::AddTimer: Timer Added (11397291)Test Devices-->Monoprice ASwitch 232(1441)
2022-04-25 16:21:21.985 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: BoundCall: [command: ][notify: VOLUME_LEVEL_CHANGED]
2022-04-25 16:21:21.986 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: asyncWriteImpl(): Writing payload [][size: 244]
2022-04-25 16:21:21.986 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: BoundCall: [command: ][notify: VOLUME_LEVEL_CHANGED]
2022-04-25 16:21:21.987 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: asyncWriteImpl(): Writing payload [127.0.0.1:46032][size: 244]
2022-04-25 16:21:21.987 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: asyncWriteImpl(): Writing payload [192.168.70.50:58996][size: 244]
2022-04-25 16:21:21.987 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: handleWrite(): Wrote 244 bytes to []
2022-04-25 16:21:21.988 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: asyncWriteImpl(): Writing payload [192.168.50.80:60858][size: 244]
2022-04-25 16:21:21.988 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: handleWrite(): Wrote 244 bytes to [127.0.0.1:46032]
2022-04-25 16:21:21.988 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: handleWrite(): Wrote 244 bytes to [192.168.70.50:58996]
2022-04-25 16:21:21.988 +1200 ea5-000FFF98EC5D [5427] (6515) TRACE: handleWrite(): Wrote 244 bytes to [192.168.50.80:60858]
2022-04-25 16:21:22.008 +1200 ea5-000FFF98EC5D [5427] (5427) TRACE: DeviceStreamConnection::handleData: Received serial packet [device id: 15][name: Control4 EA-5]: <11VO

So the primary issue is getting the LEVEL parameter to be used before I then set about scaling this to the appropriate range.

The driver is a simple one-way RS232 driver created in Driver wizard with discrete volume control, which allows the LEVEL variable to be used - as shown in the screenshot below.  I don't have a need for 2 way comms as I am controlling this matrix solely from Control4.
The format for the serial command to update the volume is <nnVOvv CR where nn is the amp output zone, and vv is the volume level (0-38)
I have created a macro for each zone output volume - for example for zone 1 the serial code is "<11VO" %2EDLEVEL "\r" - which I am expecting to convert the LEVEL variable into a 2 digit decimal using big endian order.
There is a space either side of the %2EDLEVEL parameter in the serial code definition.

 

image.png

 

Is anyone able to see what I am doing wrong?
Thanks in advance.

 

Link to comment
Share on other sites

  • 0

I made a 2 way serial driver for a similar unit. The matrix only version. Protocol is the same for the matrix and matrix amp version. This is also a very white labeled unit, lots of manufactures have a version of this with the same protocol. I never did any real world testing on it as we never installed the unit. I only built the driver for a single unit so if you stack multiple units together the driver will not work. I know either here or on facebook someone else built a driver that "should" work with stacked units but I tested their driver and did not like something about it... Just can't remember what it was. DM me if your interested in the driver.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.