Getting Data Back From A Module (Correct Method)
xrmichael
Junior Member
To the detriment of my social and family life, for the last few weeks i have been on with some modules for various bits of kit. After many pitfalls and suffering from ATOI ASCII To Insanity, they now seem to be working in a fashion. I now need to get the information back from the modules, each module contains variables/arrays within it holding the data i need, i presumed i could have read this information direct from my main programme but these variables are local to the module. So less rambling and to the questions.
My AMP module has an array of zone volumes i want to turn this into 12 levels, is the inbuilt CREATE_LEVEL suitable for this or is it for the Volume Card only. This array is updated every 2 secs from the amp and i only want to update the level on a change.
The dab module is holding info on station name, preset etc. Should i send this back with a SEND_STRING or can you make a Global Variable in the module and read it from the main programme.
Is there a nifty trick to see if data in my array has changed and then transmit the change sort of
If new vol <> old vol do this
Sorry for the garbled post.
My AMP module has an array of zone volumes i want to turn this into 12 levels, is the inbuilt CREATE_LEVEL suitable for this or is it for the Volume Card only. This array is updated every 2 secs from the amp and i only want to update the level on a change.
The dab module is holding info on station name, preset etc. Should i send this back with a SEND_STRING or can you make a Global Variable in the module and read it from the main programme.
Is there a nifty trick to see if data in my array has changed and then transmit the change sort of
If new vol <> old vol do this
Sorry for the garbled post.
Comments
-
To the detriment of my social and family life, for the last few weeks i have been on with some modules for various bits of kit. After many pitfalls and suffering from ATOI ASCII To Insanity, they now seem to be working in a fashion. I now need to get the information back from the modules, each module contains variables/arrays within it holding the data i need, i presumed i could have read this information direct from my main programme but these variables are local to the module. So less rambling and to the questions.
My AMP module has an array of zone volumes i want to turn this into 12 levels, is the inbuilt CREATE_LEVEL suitable for this or is it for the Volume Card only. This array is updated every 2 secs from the amp and i only want to update the level on a change.
The dab module is holding info on station name, preset etc. Should i send this back with a SEND_STRING or can you make a Global Variable in the module and read it from the main programme.
Is there a nifty trick to see if data in my array has changed and then transmit the change sort of
If new vol <> old vol do this
Sorry for the garbled post.
Use levels on the virtual device associated with the module, and yes create_level is an option. Keep your variables local to the module unless they need to be persistent, and create your own protocol to deliver the information outside of the module with send_command (just because that's the current AMX standard). For example SEND_COMMAND vdvDev, "''CURRENTSTATIONNAME='',uStationCurrent.Name,$0A" -
Module
I have altered the Module a bit and its internal array holing volume etc is now split to current volume and new volume so i can tell and do something if the volume changes, i suppose the ? is what benefit do i get from creating a level do i need to create level. Am i not via the code already maintaining my own level ?
Basically i want to see all 12 amp levels from 1 page on the tp when done. -
Thought
You don't have to use Levels. If in your module you are sending out to the virtual device the number, and once your virtual device receives the update... you should be done.
Another way to do it, instead of using virtual devices, is to pass a variable from main code into the module, then have your module's variable = the passed in variable.
I use that in my cable/sat module, because a module can not hold a persistent variable. -
I have altered the Module a bit and its internal array holing volume etc is now split to current volume and new volume so i can tell and do something if the volume changes, i suppose the ? is what benefit do i get from creating a level do i need to create level. Am i not via the code already maintaining my own level ?
Basically i want to see all 12 amp levels from 1 page on the tp when done.
Why are you checking if the volume changes? I don't know what gear you are using but most preamps only send out data on a change so there is no need to poll or check for a different value.
Paul -
Module
This doesn't. It sends it current stats ever 2s you can ask for the stats for a channel but to do this would be 12 request and 12 replies ontop of the regular stats broadcast that i cannot stop, so i thought i was on the least traffic road.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
