Sony Camera Presets
David_w
Junior Member
I am trying to write code that will allow me to store presets for a Sony Camera. I would like to touch Preset then touch Preset 1,2, or 3 and it would then store the Preset to that number. Below is the code I am trying to use but I have errors. Thanks for any help.
Define Vars
ncampreset1 // button 109
ncampreset2 // button 110
ncampreset3 // buton 111
ncamsetpre // button 112
Program:
BUTTON_EVENT[dvTP,112]
{
PUSH:
{
If ncamsetpre = ncampreset1 // FIRST ERROR
send_string dvCam,"$81,$01,$04,$3f,$01,$00,$ff"
}
{
Else if ncamsetpre = ncampreset2
send_string dvCam,"$81,$01,$04,$3f,$01,$01,$ff"
}
{
else ncamsetpre = ncampreset3
send_string dvCam,"$81,$01,$04,$3f,$01,$02,$ff"
}
}
[dvTP,109] = ncampreset1
[dvTP,110] = ncampreset2
[dvTP,111] = ncampreset3
[dvTP,112] = ncamsetpre
Define Vars
ncampreset1 // button 109
ncampreset2 // button 110
ncampreset3 // buton 111
ncamsetpre // button 112
Program:
BUTTON_EVENT[dvTP,112]
{
PUSH:
{
If ncamsetpre = ncampreset1 // FIRST ERROR
send_string dvCam,"$81,$01,$04,$3f,$01,$00,$ff"
}
{
Else if ncamsetpre = ncampreset2
send_string dvCam,"$81,$01,$04,$3f,$01,$01,$ff"
}
{
else ncamsetpre = ncampreset3
send_string dvCam,"$81,$01,$04,$3f,$01,$02,$ff"
}
}
[dvTP,109] = ncampreset1
[dvTP,110] = ncampreset2
[dvTP,111] = ncampreset3
[dvTP,112] = ncamsetpre
Comments
-
The expression you're testing for true/false needs to be in parenthesis.
IF (this = that) { // this runs if this equals that }In NL Studio, Help -> Netlinx Keywords is an INVALUABLE source of information that may have helped you out in the the space of time it took for you to post that.
You're also not showing us where values get assigned to variables, but your feedback statements probably aren't going to do what you want. If you want button 109 to light up when ncamsetpre equeals ncampreset1, you want this:[dvTP,109] = (ncamsetpre = ncampreset1) // kind of an implied IF - if the values are equal, light up the button
The way you have it in your example, button 109 would light up any time the variable ncampreset1 was equal to anything but zero.
Also - you do know that there are existing modules for a lot of equipment - including Sony cameras, right? I'm not going to knock you for doing it the way you've started, 'cos you'll learn a lot, but if you just want to get a camera up & running for a job, you might want to look into getting the module...
- Chip -
Thanks
Thanks Chip, I do know there are module. I am just trying to teach myself how to code in AMX. Trying to get myself to think in same logic format. Since I doing this for fun right now, I can take my time and try new stuff while getting help from others. Thank you so much for your help. -
I suspected that was the case. Good luck, & Rock 'n roll!
- ChipDavid_w wrote:Thanks Chip, I do know there are module. I am just trying to teach myself how to code in AMX. Trying to get myself to think in same logic format. -
Try this!David_w wrote:I am just trying to teach myself how to code in AMX. Trying to get myself to think in same logic format.DEFINE_CONSTANT INTEGER btCamStore = 10; INTEGER btCamPreset[] = { 11,12,13 }; DEFINE_VARIABLE INTEGER nCamSelected; INTEGER nStorePre; //########################################################### BUTTON_EVENT[dvTP_Cams, btCamStore] { PUSH: nStorePre = 1; } //########################################################### BUTTON_EVENT[dvTP_Cams, btAudienceCam] { PUSH: { nCamSelected = get_last(btAudienceCam); (* Send Preset *) if(nStorePre == 0) { send_string dvSonCam, "$81,$01,$04,$3F,$02, nCamSelected-1 ,$FF"; } (* Store Preset *) else { send_string dvSonCam, "$81,$01,$04,$3F,$01, nCamSelected-1 ,$FF"; nStorePre = 0; } } } DEFINE_PROGRAM [dvTP,btCamPreset[1]] = (nCamSelected == 1) [dvTP,btCamPreset[2]] = (nCamSelected == 2) [dvTP,btCamPreset[3]] = (nCamSelected == 3)
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