Asked
— Edited
In a couple of scripts I have commands to start a camera, however, if the camera is already on, when the command to start it runs - the camera stops. Also, in a script, I have a command to stop a camera and when that runs the camera does not stop. My project has 2 cameras.
Has anyone else run across this?
So I've been playing around with problem a little more. When I run this script with the cameras turned off everything works.
If I run it with the the cameras on they shut off when they should be on. I'm still unable to get Camera2 to stop in a this script though. Can anyone see what the problem might be?
This may help. In my init script, I toggle the camera off and back on as a workarond to the issue that the grid lines are sometimes off center. I use the $IsCameraActive variable to determine if it is running first. I only have one camera, so I am not sure what the variable name is with a second camera or if you will need to customize it.
@thetechguru, that got me thinking on the right track. I'll put a couple of " check camera" lines in. Thanks for your help.
I've tried to run the code below to control a second camera but I get the dreaded - Variable not defined: $IsCamera2Active. I've tried to define Camera2 with it's connection number - $Camera2 = EZB://192.168.2.94 but that doesn't work.
How do I define Camera2 ?
Thanks
You define the variables in the settings of the camera object. There are automatically created variables when you add the camera object, but when you add a second camera, it doesn't create new variables, so you need to manually update them.
Click on the settings gear in the lower left corner of the camera object, then the scripts button, then the variables tab, and rename all the variables to reference your second camera.
See screen shot below: