embarrassing
PyroGuy
Junior Member
Ok - no such thing as a dumb question but...
What is the trick to converting a FLOAT to Integer? I need to convert a level conversion value which is is returning 4 decimal accuracy but need only the integer value to send the the Autopatch router.
Define_Variable
FLOAT Vol
FLOAT Vol2
Define_Event
...
Vol2 = ((Vol / 3.1875) -70)
Vol3 = (Vol2*10)
SEND_STRING dvAswitch, "'CO9VA',ItoA(vol3),'T'"
I am feeling really dumb right now - and it's really late!.
Thanks for not snickering (out loud!)
What is the trick to converting a FLOAT to Integer? I need to convert a level conversion value which is is returning 4 decimal accuracy but need only the integer value to send the the Autopatch router.
Define_Variable
FLOAT Vol
FLOAT Vol2
Define_Event
...
Vol2 = ((Vol / 3.1875) -70)
Vol3 = (Vol2*10)
SEND_STRING dvAswitch, "'CO9VA',ItoA(vol3),'T'"
I am feeling really dumb right now - and it's really late!.
Thanks for not snickering (out loud!)
Comments
-
It's late here, and I've been playing with Java for the past few days, but I think you can just make vol2 an INTEGER instead of FLOAT and it should work.
You might need to do a TYPE_CAST() to avoid compiler warnings.
Jeff -
PyroGuy wrote:Ok - no such thing as a dumb question but...
What is the trick to converting a FLOAT to Integer? I need to convert a level conversion value which is is returning 4 decimal accuracy but need only the integer value to send the the Autopatch router.
Define_Variable
FLOAT Vol
FLOAT Vol2
Define_Event
...
Vol2 = ((Vol / 3.1875) -70)
Vol3 = (Vol2*10)
SEND_STRING dvAswitch, "'CO9VA',ItoA(vol3),'T'"
I am feeling really dumb right now - and it's really late!.
Thanks for not snickering (out loud!)
(silently snickering)
Why are you doing this? If its an Autopatch switch then you shouldn't need to do any volume arithmetic at all as it is done in the module.
Paul -
My guess would be because the Autopatch module is not very functional (at least the last time I tried it). I wrote my own module for the Autopatch PrecisLT because the one available was lacking most of the functionality I needed.
Jeff -
Spire_Jeff wrote:My guess would be because the Autopatch module is not very functional (at least the last time I tried it). I wrote my own module for the Autopatch PrecisLT because the one available was lacking most of the functionality I needed.
Jeff
Interesting. I am using the autopatch module right now and the only thing it is missing is the eq stuff that should get added sometime soon. So far it has worked really well, so I am not sure why you would need to rebuild it. All the volume arithmetic is done for me so that my volume feedback has a level in the range of 0-255 and I just send it the level.value of the virtual output volume.
Paul -
I'm not using the module - the switching that is being done is very simple so sending a BCS command was easier. Also - I haven't looked at the module but if it is written for a modero panel, I have a lot of reworking to do as this project is using some G3s. (I discovered THAT treat when I started playing with the Sharp projector module. As a newbie to modules, THAT was a treat in itself - remapping the address codes for buttons and feedback!
The command requires a value which was being created when converting from a level (0-255) to a db value for the switcher (Vol / 3.1875) -70) which was something I learned from a previous post. (AP ranges from -70db to +10db)
Some subsequent playing around seems to indicate that the Autopatch could care less about the decimal value and it seems to work as I have it coded...
Vol2 = ((Vol / 3.1875) -70)
Vol3 = (Vol2*10)
SEND_STRING dvAswitch, "'CO9VA',ItoA(vol3),'T'"
Go figure - but it's nice to think you are wrong and find out that it works anyway!
Cheers!
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