Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The MATRIX node takes two arguments, 'row' and 'col', as input.

Based on these inputs, it generates a random matrix where the integers inside the matrix are between 0 and 19.

Parameters
----------
status : True
either True or False value that you want to assign

Returns
-------
Boolean
Boolean node
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The CAN_MESSAGE node sends a message onto CAN network through a slcan-compatible USB-to-CAN adapter.

Inputs
------
default: Vector
The array of data to send to the CAN bus.

Parameters
----------
arbitration_id:
Unique ID for message being sent.
is_extended_id: bool
Flag that controls the size of the arbitration_id field.

Returns
-------
None
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The PROLOGIX_ADDR node sets the GPIB address of an instrument using the Prologix USB-to-GPIB or USB-to-Ethernet adapter.

Inputs
------
default: DataContainer
Any DataContainer - likely connected to the output of the OPEN_SERIAL node.

Parameters
----------
connection: Serial
The open serial connection with the instrument.

Returns
-------
TextBlob
Response from the Prologix USB-to-GPIB controller.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The PROLOGIX_AUTO node toggles "Read-After-Write" mode on or off.

When Read-After-Write is on, the Prologix USB-to-GPIB controller automatically reads a bench-top instrument's response after writing a command to it.

Inputs
------
default: DataContainer
Any DataContainer - likely connected to the output of the OPEN_SERIAL node.

Parameters
----------
connection: Serial
The open serial connection with the instrument.

Returns
-------
TextBlob
Response from the Prologix USB-to-GPIB controller.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The PROLOGIX_HELP command returns a list of available Prologix USB-to-GPIB firmware commands.

Inputs
------
default: DataContainer
Any DataContainer - likely connected to the output of the OPEN_SERIAL node.

Parameters
----------
connection: Serial
The open serial connection with the instrument.

Returns
-------
TextBlob
A list of available Prologix USB-to-GPIB firmware commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
The PROLOGIX_MODE node sets the mode of the Prologix USB-to-GPIB controller - 1 for CONTROLLER mode and 0 for DEVICE mode.

From the Prologix manual:

In Controller mode, the GPIB-USB Controller acts as the Controller-In-Charge (CIC)
on the GPIB bus. When the controller receives a command over the USB port
terminated by the USB terminator – CR (ASCII 13) or LF (ASCII 10) – it addresses the
GPIB instrument at the currently specified address (See ++addr command) to listen, and
passes along the received data.

In Device mode, Prologix GPIB-USB Controller acts as another peripheral on the GPIB
bus. In this mode, the controller can act as a GPIB TALKER or GPIB LISTENER
only. Since Prologix GPIB-USB Controller is not the Controller-In-Charge while in this
mode, it expects to receive commands from a GPIB controller. When Device mode is
enabled Prologix GPIB-USB controller configures itself as a GPIB Listener. All data
received by the controller over the GPIB port is passed along to the USB port without
buffering.

Inputs
------
default: DataContainer
Any DataContainer - likely connected to the output of the OPEN_SERIAL node.

Parameters
----------
connection: Serial
The open serial connection with the instrument.

Returns
-------
TextBlob
Response from the Prologix USB-to-GPIB controller.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The PROLOGIX_VER command queries the Prologix USB-to-GPIB firmware version.

Inputs
------
default: DataContainer
Any DataContainer - likely connected to the output of the OPEN_SERIAL node.

Parameters
----------
connection: Serial
The open serial connection with the instrument.

Returns
-------
TextBlob
The Prologix controller available commands.
16 changes: 16 additions & 0 deletions docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The SCPI_WRITE node writes a SCPI command to a connected bench-top instrument and returns the result.

Inputs
------
default: DataContainer
Any DataContainer - likely connected to the output of the OPEN_SERIAL node.

Parameters
----------
connection: Serial
The open serial connection with the instrument.

Returns
-------
Scalar|TextBlob
The return value from the bench-top instrument as a Scalar or TextBlob.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": null,
"parameters": [
{
"name": "device",
"type": "Serial",
"description": "The connected serial device."
}
],
"returns": [
{
"name": null,
"type": "TextBlob",
"description": null
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ from flojoy.connection_manager import DeviceConnectionManager

@flojoy(deps={"pyserial": "3.5"})
def OPEN_SERIAL(device: SerialDevice, baudrate: int = 9600) -> TextBlob:
"""The OPEN_SERIAL node opens a serial connection through your computer's USB or RS-232 port.
Parameters
----------
device: Serial
The connected serial device.
Returns
-------
TextBlob
"""


ser = serial.Serial(
port=device.get_port(),
Expand All @@ -27,4 +19,4 @@ def OPEN_SERIAL(device: SerialDevice, baudrate: int = 9600) -> TextBlob:

DeviceConnectionManager.register_connection(device, ser)

return TextBlob(text_blob=json.dumps(ser.get_settings()))
return TextBlob(text_blob=json.dumps(ser.get_settings()))
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"description": null,
"parameters": [
{
"name": "baudrate",
"type": "int",
"description": "Baud rate for the serial communication."
},
{
"name": "comport",
"type": "string",
"description": "Defines the comunication port on which the serial device is connected."
}
],
"returns": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"description": null,
"parameters": [
{
"name": "num_readings",
"type": "int",
"description": "Number of points to record."
},
{
"name": "record_period",
"type": "float",
"description": "Length between two recordings in seconds."
},
{
"name": "baudrate",
"type": "int",
"description": "Baud rate for the serial device."
},
{
"name": "comport",
"type": "string",
"description": "COM port of the serial device."
},
{
"name": "num_readings * record_period",
"type": "",
"description": "Is roughly the run length in seconds."
}
],
"returns": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The AND node takes two boolean data type and computs logical AND operation on them.

Inputs
------
default : Boolean
The input boolean to which we apply the AND operation.

a : Boolean
The input boolean to which we apply the AND operation.

Returns
-------
Boolean
The boolean result from the operation of the inputs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The EXCLUSIVE_OR node takes two boolean data type and computs logical EXCLUSIVE OR operation on them.

Inputs
------
default : Boolean
The input boolean to which we apply the EXCLUSIVE OR operation.

a : Boolean
The input boolean to which we apply the EXCLUSIVE OR operation.

Returns
-------
Boolean
The boolean result from the operation of the inputs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
The IMPLIES node takes two boolean data type and computs logical IMPLIES operation on them.
x implies y

Inputs
------
default : Boolean
The input boolean to which we apply the IMPLIES operation.

a : Boolean
The input boolean to which we apply the IMPLIES operation.

Returns
-------
Boolean
The boolean result from the operation of the inputs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The NOT node takes a boolean data type and computs logical NOT operation on them.

Inputs
------
default : Boolean
The input boolean to which we apply the NOT operation.

Returns
-------
Boolean
The boolean result from the operation of the input.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The NOT_AND node takes two boolean data type and computs logical NOT AND operation on them.

Inputs
------
default : Boolean
The input boolean to which we apply the NOT AND operation.

a : Boolean
The input boolean to which we apply the NOT AND operation.

Returns
-------
Boolean
The boolean result from the operation of the inputs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The NOT_OR node takes two boolean data type and computs logical NOT OR operation on them.

Inputs
------
default : Boolean
The input boolean to which we apply the NOT OR operation.

a : Boolean
The input boolean to which we apply the NOT OR operation.

Returns
-------
Boolean
The boolean result from the operation of the inputs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The OR node takes two boolean data type and computs logical OR operation on them.

Inputs
------
default : Boolean
The input boolean to which we apply the OR operation.

a : Boolean
The input boolean to which we apply the OR operation.

Returns
-------
Boolean
The boolean result from the operation of the inputs.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def ADD(
a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector]
) -> OrderedPair | Scalar | Vector:


initial = get_val(a)
seq = map(lambda dc: get_val(dc), b)
y = reduce(lambda u, v: np.add(u, v), seq, initial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def MULTIPLY(
a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector]
) -> OrderedPair | Scalar | Vector:


initial = get_val(a)
seq = map(lambda dc: get_val(dc), b)
y = reduce(lambda u, v: np.multiply(u, v), seq, initial)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The BOOLEAN_2_SCALAR node takes boolean type data and converts it into scalar data type.
1 means true and 0 means false

Inputs
------
default : Boolean
The input boolean to which we apply the conversion to.

Returns
-------
Scalar
The scalar result from the conversion of the input.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The ORDERED_PAIR_2_VECTOR return the y component of an ordered pair as a Vector.

Inputs
------
default : OrderedPair
The input OrderedPair.

Returns
-------
Vector
The y component of the input OrderedPair.
Loading