This element allows you access to PhidgetAnalog devices, boards with analog outputs, like device 1002.
The PhidgetAnalog 4-Output (1002) Produces a voltage over -10V to +10V. This voltage will be asserted up to +-20mA. An error will be reported when this current is exceeded, and the voltage the customer is getting is no longer accurate. The voltage is produced with 12 bit resolution (4.8mV).
The board is not isolated and all 4 channels share a common ground.
All the power is supplied by the USB bus.
To use any Phidget element, drag an drop its icon to the list of model elements of your model. Then, edit the connection parameters and invoke phidget.connect() in your code.
All methods returning a boolean will return true on successful completion of the command, false otherwise. Methods returning a double value will return Double.NaN if there is any error when connecting to the phidget.
Available method for this group of phidgets include:
public boolean connect(); // establish the connection. Returns true if successful
public int getOutputCount(); //Returns the number of analog outputs on the device.
public int enableAnalogOutput(int ind,boolean value); //Enables an analog output. Setting this to true will activate the output, false is the default state.
public int getAnalogStatus(int ind); //Gets the enabled state for an output.
public boolean setVoltage(int ind, double value); //Sets the voltage output setting for an analog output.
public boolean getVoltage(int ind); //Gets the voltage output setting of an analog output.
public boolean getAnalogMin(int ind); //Gets the minimum voltage for an analog output.
public boolean getAnalogMax(int ind); //Gets the maximum voltage for an analog output.
// Init the module ap.connect(); // enables all outputs for (int i = 0; i < ap.getOutputCount() - 1; i++) { ap.enableAnalogOutput(i, true); } // Setting the Voltage of the first Analog Output to newVoltage ap.setVoltage(0, newVoltage); //closing ap.setVoltage(0, 0); for (int i = 0; i < ap.getOutputCount() - 1; i++) { ap.enableAnalogOutput(i, false); }