diff --git a/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/docstring.txt b/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/docstring.txt index cc5b56f6dc..fa452ff52e 100644 --- a/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/docstring.txt +++ b/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/docstring.txt @@ -5,12 +5,6 @@ The PROPHET_PREDICT node runs a Prophet model on the incoming dataframe. This node always returns a DataContainer of a dataframe type. It will also always return an 'extra' field with a key 'prophet' of which the value is the JSONified Prophet model. This model can be loaded as follows: - ```python - from prophet.serialize import model_from_json - - model = model_from_json(dc_inputs.extra["prophet"]) - ``` - Parameters ---------- run_forecast : bool diff --git a/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/python_code.txt b/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/python_code.txt index 8bec0373f8..e1cace53c6 100644 --- a/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/python_code.txt +++ b/docs/nodes/AI_ML/PREDICT_TIME_SERIES/PROPHET_PREDICT/a1-[autogen]/python_code.txt @@ -1,10 +1,10 @@ -from flojoy import flojoy, run_in_venv, DataFrame +from flojoy import DataFrame, flojoy, run_in_venv @flojoy @run_in_venv( pip_dependencies=[ - "prophet==1.1.4", + "prophet==1.1.5", ] ) def PROPHET_PREDICT( @@ -14,9 +14,9 @@ def PROPHET_PREDICT( import os import sys - import pandas as pd - import numpy as np + import numpy as np + import pandas as pd import prophet from prophet.serialize import model_to_json diff --git a/docs/nodes/GENERATORS/SIMULATIONS/MESHGRID/a1-[autogen]/docstring.txt b/docs/nodes/GENERATORS/SIMULATIONS/MESHGRID/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/GENERATORS/SIMULATIONS/RAND_VEC/a1-[autogen]/docstring.txt b/docs/nodes/GENERATORS/SIMULATIONS/RAND_VEC/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/GENERATORS/SIMULATIONS/TRIPLE/a1-[autogen]/docstring.txt b/docs/nodes/GENERATORS/SIMULATIONS/TRIPLE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/IMAGING/OPEN_REALSENSE/a1-[autogen]/docstring.txt b/docs/nodes/IO/IMAGING/OPEN_REALSENSE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/IMAGING/OPEN_TAU_LIDAR/a1-[autogen]/docstring.txt b/docs/nodes/IO/IMAGING/OPEN_TAU_LIDAR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/IMAGING/REALSENSE/a1-[autogen]/docstring.txt b/docs/nodes/IO/IMAGING/REALSENSE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/IMAGING/TAU_LIDAR/a1-[autogen]/docstring.txt b/docs/nodes/IO/IMAGING/TAU_LIDAR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/TINYMOVR_CALIBRATE.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/TINYMOVR_CALIBRATE.md new file mode 100644 index 0000000000..9df17483b9 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/TINYMOVR_CALIBRATE.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/docstring.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..988ede1bca --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": null, + "parameters": [ + { + "name": "None", + "type": null, + "description": null + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": "Traceback error" + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/docstring.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..4caa19c488 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/docstring.txt @@ -0,0 +1,10 @@ +Discover and calibrate a connected tinymovr BLDC driver through a CANine USB-to-CAN controller. + + Parameters + ---------- + None + + Returns + ------- + TextBlob + Traceback error diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/python_code.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..08e4e374e5 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/a1-[autogen]/python_code.txt @@ -0,0 +1,26 @@ +from flojoy import flojoy, TextBlob + +import can, traceback +from tinymovr.tee import init_tee, destroy_tee +from tinymovr.config import get_bus_config, create_device + + +@flojoy(deps={"tinymovr": "1.6.2"}) +def TINYMOVR_CALIBRATE() -> TextBlob: + + + bitrate = 1000000 + params = get_bus_config(["canine", "slcan_disco"]) + params["bitrate"] = bitrate + tb = "" + + try: + with can.Bus(**params) as bus: + init_tee(can.Bus(**params)) + tm = create_device(node_id=1) + tm.controller.calibrate() + destroy_tee() + except: + tb = traceback.format_exc() + + return TextBlob(text_blob=tb) diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/hardware.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/media.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/notes.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/examples/EX1/app.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/examples/EX1/app.json new file mode 100644 index 0000000000..124d111404 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/examples/EX1/app.json @@ -0,0 +1,754 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 96, + "height": 96, + "id": "LOOP-75e7d747-dffb-43bd-95ad-7c63b0d5dad3", + "type": "LOGIC_GATES", + "data": { + "id": "LOOP-75e7d747-dffb-43bd-95ad-7c63b0d5dad3", + "label": "LOOP", + "func": "LOOP", + "type": "LOGIC_GATES", + "ctrls": { + "num_loops": { + "type": "int", + "default": -1, + "desc": "number of times to iterate through body nodes, default is \"-1\" meaning infinity.", + "overload": null, + "functionName": "LOOP", + "param": "num_loops", + "value": -1 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "body", + "id": "body", + "type": "Any", + "desc": null + }, + { + "name": "end", + "id": "end", + "type": "Any", + "desc": null + } + ], + "path": "LOGIC_GATES/LOOPS/LOOP/LOOP.py", + "selected": false + }, + "position": { + "x": -116.29948702183822, + "y": 59.913468061214076 + }, + "selected": false, + "positionAbsolute": { + "x": -116.29948702183822, + "y": 59.913468061214076 + }, + "dragging": true + }, + { + "width": 96, + "height": 96, + "id": "LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1", + "type": "LOGIC_GATES", + "data": { + "id": "LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1", + "label": "LOOP INDEX", + "func": "LOOP_INDEX", + "type": "LOGIC_GATES", + "ctrls": { + "loop_node": { + "type": "NodeReference", + "default": null, + "desc": "The LOOP node to track the loop index from.", + "overload": null, + "functionName": "LOOP_INDEX", + "param": "loop_node", + "value": "LOOP-75e7d747-dffb-43bd-95ad-7c63b0d5dad3" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "The loop index in Scalar form." + } + ], + "path": "LOGIC_GATES/LOOP_TOOLS/LOOP_INDEX/LOOP_INDEX.py", + "selected": false + }, + "position": { + "x": 83.64627496051924, + "y": 2.4822128172604607 + }, + "selected": false, + "positionAbsolute": { + "x": 83.64627496051924, + "y": 2.4822128172604607 + }, + "dragging": true + }, + { + "width": 96, + "height": 96, + "id": "TIMER-28a4d905-a57c-4e51-991a-94a92a861ee7", + "type": "LOGIC_GATES", + "data": { + "id": "TIMER-28a4d905-a57c-4e51-991a-94a92a861ee7", + "label": "TIMER", + "func": "TIMER", + "type": "LOGIC_GATES", + "ctrls": { + "sleep_time": { + "type": "float", + "default": 0, + "desc": "number of seconds to sleep", + "overload": null, + "functionName": "TIMER", + "param": "sleep_time", + "value": 0 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": null + } + ], + "path": "LOGIC_GATES/TIMERS/TIMER/TIMER.py", + "selected": false + }, + "position": { + "x": 1079.3674744809105, + "y": 316.79694538939 + }, + "selected": false, + "positionAbsolute": { + "x": 1079.3674744809105, + "y": 316.79694538939 + }, + "dragging": true + }, + { + "width": 72, + "height": 72, + "id": "MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744", + "type": "ARITHMETIC", + "data": { + "id": "MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744", + "label": "MULTIPLY", + "func": "MULTIPLY", + "type": "ARITHMETIC", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "a", + "id": "a", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "The input a use to compute the product of a and b." + }, + { + "name": "b", + "id": "b", + "type": "OrderedPair|Scalar|Vector", + "multiple": true, + "desc": "The input b use to compute the product of a and b." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "desc": "OrderedPair if a is an OrderedPair.\nx: the x-axis of input a.\ny: the result of the product of input a and input b.\n\nScalar if a is a Scalar.\nc: the result of the product of input a and input b.\n\nVector if a is a Vector.\nv: the result of the product of input a and input b." + } + ], + "path": "TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.py", + "selected": false + }, + "position": { + "x": 390.125498058375, + "y": 344.50805752457296 + }, + "selected": false, + "positionAbsolute": { + "x": 390.125498058375, + "y": 344.50805752457296 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "CONSTANT-e9fc3f1b-fdac-4192-9333-5697952c55de", + "type": "GENERATORS", + "data": { + "id": "CONSTANT-e9fc3f1b-fdac-4192-9333-5697952c55de", + "label": "1", + "func": "CONSTANT", + "type": "GENERATORS", + "ctrls": { + "dc_type": { + "type": "select", + "options": [ + "Scalar", + "Vector", + "OrderedPair" + ], + "default": "OrderedPair", + "desc": "The type of DataContainer to return.", + "overload": null, + "functionName": "CONSTANT", + "param": "dc_type", + "value": "Scalar" + }, + "constant": { + "type": "float", + "default": 3, + "desc": "The value of the y axis output.", + "overload": null, + "functionName": "CONSTANT", + "param": "constant", + "value": 1 + }, + "step": { + "type": "float", + "default": 1000, + "desc": "The size of the y and x axes.", + "overload": null, + "functionName": "CONSTANT", + "param": "step", + "value": 1000 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input that defines the size of the output." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Vector|Scalar", + "desc": "OrderedPair if selected\nx: the x axis generated with size 'step'\ny: the resulting constant with size 'step'\nVector if selected\nv: the resulting constant with size 'step'\nScalar if selected\nc: the resulting constant" + } + ], + "path": "GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.py", + "selected": false + }, + "position": { + "x": 82.77858624045928, + "y": 420.26330517604515 + }, + "selected": false, + "positionAbsolute": { + "x": 82.77858624045928, + "y": 420.26330517604515 + }, + "dragging": true + }, + { + "width": 96, + "height": 96, + "id": "CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7a", + "type": "CONDITIONALS", + "data": { + "id": "CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7a", + "label": "CONDITIONAL", + "func": "CONDITIONAL", + "type": "CONDITIONALS", + "ctrls": { + "operator_type": { + "type": "select", + "options": [ + "<=", + ">", + "<", + ">=", + "!=", + "==" + ], + "default": ">=", + "desc": "Specifies the type of comparison to be performed between the two inputs. The default value is \">=\".", + "overload": null, + "functionName": "CONDITIONAL", + "param": "operator_type", + "value": ">=" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "x", + "id": "x", + "type": "Scalar", + "multiple": false, + "desc": null + }, + { + "name": "y", + "id": "y", + "type": "Scalar", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "true", + "id": "true", + "type": "Any", + "desc": null + }, + { + "name": "false", + "id": "false", + "type": "Any", + "desc": null + } + ], + "path": "LOGIC_GATES/CONDITIONALS/CONDITIONAL/CONDITIONAL.py", + "selected": false + }, + "position": { + "x": 315.0608334890218, + "y": -181.3168225871309 + }, + "selected": false, + "positionAbsolute": { + "x": 315.0608334890218, + "y": -181.3168225871309 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "CONSTANT-c92203cf-b9e9-4ff1-a501-958e728cbb4f", + "type": "GENERATORS", + "data": { + "id": "CONSTANT-c92203cf-b9e9-4ff1-a501-958e728cbb4f", + "label": "15", + "func": "CONSTANT", + "type": "GENERATORS", + "ctrls": { + "dc_type": { + "type": "select", + "options": [ + "Scalar", + "Vector", + "OrderedPair" + ], + "default": "OrderedPair", + "desc": "The type of DataContainer to return.", + "overload": null, + "functionName": "CONSTANT", + "param": "dc_type", + "value": "Scalar" + }, + "constant": { + "type": "float", + "default": 3, + "desc": "The value of the y axis output.", + "overload": null, + "functionName": "CONSTANT", + "param": "constant", + "value": 15 + }, + "step": { + "type": "float", + "default": 1000, + "desc": "The size of the y and x axes.", + "overload": null, + "functionName": "CONSTANT", + "param": "step", + "value": 1000 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input that defines the size of the output." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Vector|Scalar", + "desc": "OrderedPair if selected\nx: the x axis generated with size 'step'\ny: the resulting constant with size 'step'\nVector if selected\nv: the resulting constant with size 'step'\nScalar if selected\nc: the resulting constant" + } + ], + "path": "GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.py", + "selected": false + }, + "position": { + "x": 4.795074623791379, + "y": -216.54312770220974 + }, + "selected": false, + "positionAbsolute": { + "x": 4.795074623791379, + "y": -216.54312770220974 + }, + "dragging": true + }, + { + "width": 96, + "height": 96, + "id": "BREAK-3f1a901d-47ac-4fd7-bfb7-ed690816f36a", + "type": "LOGIC_GATES", + "data": { + "id": "BREAK-3f1a901d-47ac-4fd7-bfb7-ed690816f36a", + "label": "BREAK", + "func": "BREAK", + "type": "LOGIC_GATES", + "ctrls": { + "referred_node": { + "type": "NodeReference", + "default": null, + "desc": "This is the specific instance of a LOOP node that you want to break.\nIt is required to differentiate between multiple LOOPs if they exist\nin the same application.", + "overload": null, + "functionName": "BREAK", + "param": "referred_node", + "value": "" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "This node simply requires an input (most likely from\nthe return of a CONDITIONAL node) so that it is executed." + } + ], + "path": "LOGIC_GATES/LOOP_TOOLS/BREAK/BREAK.py", + "selected": false + }, + "position": { + "x": 523.7614379895599, + "y": -240.5698667388382 + }, + "selected": false, + "positionAbsolute": { + "x": 523.7614379895599, + "y": -240.5698667388382 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-c2fd7485-9717-469e-8982-0ccb7c4a8f98", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-c2fd7485-9717-469e-8982-0ccb7c4a8f98", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 539.2234743407024, + "y": 234.674006466163 + }, + "selected": false, + "positionAbsolute": { + "x": 539.2234743407024, + "y": 234.674006466163 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-502b9e4d-4df5-4c71-be93-61e120f53429", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-502b9e4d-4df5-4c71-be93-61e120f53429", + "label": "PRINT DATACONTAINER", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 384.1373027816842, + "y": -20.91582777998923 + }, + "selected": false, + "positionAbsolute": { + "x": 384.1373027816842, + "y": -20.91582777998923 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-868b5fe2-e820-493a-84e1-cbc80df5ad72", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-868b5fe2-e820-493a-84e1-cbc80df5ad72", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": true + }, + "position": { + "x": 822.0900664915534, + "y": -87.75646587269875 + }, + "selected": true, + "positionAbsolute": { + "x": 822.0900664915534, + "y": -87.75646587269875 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONSTANT-e9fc3f1b-fdac-4192-9333-5697952c55de", + "sourceHandle": "default", + "target": "MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744", + "targetHandle": "b", + "id": "reactflow__edge-CONSTANT-e9fc3f1b-fdac-4192-9333-5697952c55dedefault-MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744b" + }, + { + "source": "CONSTANT-c92203cf-b9e9-4ff1-a501-958e728cbb4f", + "sourceHandle": "default", + "target": "CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7a", + "targetHandle": "y", + "id": "reactflow__edge-CONSTANT-c92203cf-b9e9-4ff1-a501-958e728cbb4fdefault-CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7ay" + }, + { + "source": "CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7a", + "sourceHandle": "true", + "target": "BREAK-3f1a901d-47ac-4fd7-bfb7-ed690816f36a", + "targetHandle": "default", + "id": "reactflow__edge-CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7atrue-BREAK-3f1a901d-47ac-4fd7-bfb7-ed690816f36adefault" + }, + { + "source": "MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744", + "sourceHandle": "default", + "target": "BIG_NUMBER-c2fd7485-9717-469e-8982-0ccb7c4a8f98", + "targetHandle": "default", + "id": "reactflow__edge-MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744default-BIG_NUMBER-c2fd7485-9717-469e-8982-0ccb7c4a8f98default" + }, + { + "source": "BIG_NUMBER-c2fd7485-9717-469e-8982-0ccb7c4a8f98", + "sourceHandle": "default", + "target": "TIMER-28a4d905-a57c-4e51-991a-94a92a861ee7", + "targetHandle": "default", + "id": "reactflow__edge-BIG_NUMBER-c2fd7485-9717-469e-8982-0ccb7c4a8f98default-TIMER-28a4d905-a57c-4e51-991a-94a92a861ee7default" + }, + { + "source": "LOOP-75e7d747-dffb-43bd-95ad-7c63b0d5dad3", + "sourceHandle": "body", + "target": "LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1", + "targetHandle": "default", + "id": "reactflow__edge-LOOP-75e7d747-dffb-43bd-95ad-7c63b0d5dad3body-LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1default" + }, + { + "source": "LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-502b9e4d-4df5-4c71-be93-61e120f53429", + "targetHandle": "default", + "id": "reactflow__edge-LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1default-PRINT_DATACONTAINER-502b9e4d-4df5-4c71-be93-61e120f53429default" + }, + { + "source": "PRINT_DATACONTAINER-502b9e4d-4df5-4c71-be93-61e120f53429", + "sourceHandle": "default", + "target": "TEXT_VIEW-868b5fe2-e820-493a-84e1-cbc80df5ad72", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-502b9e4d-4df5-4c71-be93-61e120f53429default-TEXT_VIEW-868b5fe2-e820-493a-84e1-cbc80df5ad72default" + }, + { + "source": "LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1", + "sourceHandle": "default", + "target": "CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7a", + "targetHandle": "x", + "id": "reactflow__edge-LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1default-CONDITIONAL-6d7f2f21-79d7-4ce3-97c7-f02ce04c7d7ax" + }, + { + "source": "LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1", + "sourceHandle": "default", + "target": "MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744", + "targetHandle": "a", + "id": "reactflow__edge-LOOP_INDEX-fa5ffe40-d8e7-40bb-99d8-5d41138631f1default-MULTIPLY-337609f2-02ec-4bf1-8f11-f1663e4de744a" + } + ], + "viewport": { + "x": 472.4845724041756, + "y": 354.12030268540553, + "zoom": 0.5269422050939508 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/TINYMOVR_SET_VELOCITY.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/TINYMOVR_SET_VELOCITY.md new file mode 100644 index 0000000000..333a8da836 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/TINYMOVR_SET_VELOCITY.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/docstring.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..7894f5d677 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/docstring.json @@ -0,0 +1,11 @@ +{ + "description": "Input\n-----\nvelocity : Scalar\n Servo velocity (10k ticks/sec [1, 15]).", + "parameters": [], + "returns": [ + { + "name": null, + "type": "Textblob", + "description": "Traceback error (if any)" + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/docstring.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..3c8d8087ce --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ +Direct a tinymovr BLDC driver to a set velocity. + + Input + ----- + velocity : Scalar + Servo velocity (10k ticks/sec [1, 15]). + + Returns + ------- + Textblob + Traceback error (if any) diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/python_code.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..0678df669a --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/a1-[autogen]/python_code.txt @@ -0,0 +1,36 @@ +from flojoy import flojoy, DataContainer, Scalar, TextBlob +import time, can, traceback +from typing import Optional + +from tinymovr.tee import init_tee, destroy_tee +from tinymovr.config import get_bus_config, create_device + + +@flojoy(deps={"tinymovr": "1.6.2"}) +def TINYMOVR_SET_VELOCITY(default: Scalar) -> TextBlob: + + + tb = "" + bitrate = 1000000 + params = get_bus_config(["canine", "slcan_disco"]) + params["bitrate"] = bitrate + velocity_multiplier = 10000 + MAX_v = 15 + MIN_v = 1 + + velocity = sorted((MIN_v, default.c, MAX_v))[1] + + try: + # Connect to servo over CAN network + # TODO: Consider saving Avlos tm Python object in HW device context manager + # Reference: https://github.com/tinymovr/avlos + with can.Bus(**params) as bus: + init_tee(bus) + tm = create_device(node_id=1) + tm.controller.velocity_mode() + tm.controller.velocity.setpoint = velocity * velocity_multiplier + destroy_tee() + except: + tb = traceback.format_exc() + + return TextBlob(text_blob=tb) diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/hardware.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/media.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/notes.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/examples/EX1/app.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/examples/EX1/app.json new file mode 100644 index 0000000000..0ce3a42fce --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_SET_VELOCITY/examples/EX1/app.json @@ -0,0 +1,468 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 208, + "height": 96, + "id": "SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8e", + "type": "GENERATORS", + "data": { + "id": "SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8e", + "label": "SINE", + "func": "SINE", + "type": "GENERATORS", + "ctrls": { + "amplitude": { + "type": "float", + "default": 1, + "desc": "The amplitude of the wave.", + "overload": null, + "functionName": "SINE", + "param": "amplitude", + "value": 10000 + }, + "frequency": { + "type": "float", + "default": 1, + "desc": "The wave frequency in radians/2pi.", + "overload": null, + "functionName": "SINE", + "param": "frequency", + "value": 1 + }, + "offset": { + "type": "float", + "default": 0, + "desc": "The y axis offset of the function.", + "overload": null, + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "phase": { + "type": "float", + "default": 0, + "desc": "The x axis offset of the function.", + "overload": null, + "functionName": "SINE", + "param": "phase", + "value": 0 + }, + "waveform": { + "type": "select", + "options": [ + "sine", + "square", + "triangle", + "sawtooth" + ], + "default": "sine", + "desc": "The waveform type of the wave.", + "overload": null, + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Vector", + "multiple": false, + "desc": "Input that defines the x-axis values of the function and output." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair", + "desc": "x: the input v or x values\ny: the resulting sine function" + } + ], + "path": "GENERATORS/SIMULATIONS/SINE/SINE.py", + "selected": false + }, + "position": { + "x": -240.11757149683567, + "y": 25.702132259940072 + }, + "selected": false, + "positionAbsolute": { + "x": -240.11757149683567, + "y": 25.702132259940072 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-f44a4018-13d0-4e2a-a474-bfaba7fdd57c", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-f44a4018-13d0-4e2a-a474-bfaba7fdd57c", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 10 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 0 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 1000 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between 'start' and 'end' with a 'step' number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -579.7342501929215, + "y": 25.003420793376165 + }, + "selected": false, + "positionAbsolute": { + "x": -579.7342501929215, + "y": 25.003420793376165 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "LINE-d0411371-966e-4ac7-bae7-ac296dfbf5f8", + "type": "VISUALIZERS", + "data": { + "id": "LINE-d0411371-966e-4ac7-bae7-ac296dfbf5f8", + "label": "LINE", + "func": "LINE", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly Line visualization of the input data" + } + ], + "path": "VISUALIZERS/PLOTLY/LINE/LINE.py", + "selected": false + }, + "position": { + "x": 58.26441822526766, + "y": 131.27157912186965 + }, + "selected": false, + "positionAbsolute": { + "x": 58.26441822526766, + "y": 131.27157912186965 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-252a888c-5fb7-4cf2-a0a5-f284699a4339", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-252a888c-5fb7-4cf2-a0a5-f284699a4339", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 605.7647236507444, + "y": -171.22765860906554 + }, + "selected": false, + "positionAbsolute": { + "x": 605.7647236507444, + "y": -171.22765860906554 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "ORDERED_PAIR_2_VECTOR-eb343b25-8753-4974-8e56-3ec1f46dd177", + "type": "TRANSFORMERS", + "data": { + "id": "ORDERED_PAIR_2_VECTOR-eb343b25-8753-4974-8e56-3ec1f46dd177", + "label": "ORDERED PAIR 2 VECTOR", + "func": "ORDERED_PAIR_2_VECTOR", + "type": "TRANSFORMERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair", + "multiple": false, + "desc": "The input OrderedPair." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The y component of the input OrderedPair." + } + ], + "path": "TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/ORDERED_PAIR_2_VECTOR.py", + "selected": false + }, + "position": { + "x": 88.44935080859928, + "y": -109.77519076703038 + }, + "selected": false, + "positionAbsolute": { + "x": 88.44935080859928, + "y": -109.77519076703038 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29c", + "type": "IO", + "data": { + "id": "TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29c", + "label": "TINYMOVR BLDC", + "func": "TINYMOVR_BLDC", + "type": "IO", + "ctrls": { + "sleep": { + "type": "float", + "default": 0, + "desc": "Time to wait between movements", + "overload": null, + "functionName": "TINYMOVR_BLDC", + "param": "sleep", + "value": 0 + }, + "velocity": { + "type": "float", + "default": 80000, + "desc": "Tinymovr servo velocity", + "overload": null, + "functionName": "TINYMOVR_BLDC", + "param": "velocity", + "value": 80000 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Traceback error" + } + ], + "pip_dependencies": [ + { + "name": "tinymovr", + "v": "1.6.2" + } + ], + "path": "IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_BLDC/TINYMOVR_BLDC.py", + "selected": false + }, + "position": { + "x": 328.19344567783276, + "y": -126.62290766255933 + }, + "selected": false, + "positionAbsolute": { + "x": 328.19344567783276, + "y": -126.62290766255933 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "TINYMOVR_CALIBRATE-0e6dc485-914a-4d63-b8d9-7e36270a365d", + "type": "IO", + "data": { + "id": "TINYMOVR_CALIBRATE-0e6dc485-914a-4d63-b8d9-7e36270a365d", + "label": "TINYMOVR CALIBRATE", + "func": "TINYMOVR_CALIBRATE", + "type": "IO", + "ctrls": {}, + "initCtrls": {}, + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Traceback error" + } + ], + "pip_dependencies": [ + { + "name": "tinymovr", + "v": "1.6.2" + } + ], + "path": "IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/TINYMOVR_CALIBRATE.py", + "selected": true + }, + "position": { + "x": 73.67600809515844, + "y": -347.5069775006768 + }, + "selected": true, + "positionAbsolute": { + "x": 73.67600809515844, + "y": -347.5069775006768 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-f44a4018-13d0-4e2a-a474-bfaba7fdd57c", + "sourceHandle": "default", + "target": "SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8e", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-f44a4018-13d0-4e2a-a474-bfaba7fdd57cdefault-SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8edefault" + }, + { + "source": "SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8e", + "sourceHandle": "default", + "target": "LINE-d0411371-966e-4ac7-bae7-ac296dfbf5f8", + "targetHandle": "default", + "id": "reactflow__edge-SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8edefault-LINE-d0411371-966e-4ac7-bae7-ac296dfbf5f8default" + }, + { + "source": "SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8e", + "sourceHandle": "default", + "target": "ORDERED_PAIR_2_VECTOR-eb343b25-8753-4974-8e56-3ec1f46dd177", + "targetHandle": "default", + "id": "reactflow__edge-SINE-1a56066f-d3b4-49bc-8e82-2062c8cd7e8edefault-ORDERED_PAIR_2_VECTOR-eb343b25-8753-4974-8e56-3ec1f46dd177default" + }, + { + "source": "ORDERED_PAIR_2_VECTOR-eb343b25-8753-4974-8e56-3ec1f46dd177", + "sourceHandle": "default", + "target": "TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29c", + "targetHandle": "default", + "id": "reactflow__edge-ORDERED_PAIR_2_VECTOR-eb343b25-8753-4974-8e56-3ec1f46dd177default-TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29cdefault" + }, + { + "source": "TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29c", + "sourceHandle": "default", + "target": "TEXT_VIEW-252a888c-5fb7-4cf2-a0a5-f284699a4339", + "targetHandle": "default", + "id": "reactflow__edge-TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29cdefault-TEXT_VIEW-252a888c-5fb7-4cf2-a0a5-f284699a4339default" + }, + { + "source": "TINYMOVR_CALIBRATE-0e6dc485-914a-4d63-b8d9-7e36270a365d", + "sourceHandle": "default", + "target": "TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29c", + "targetHandle": "default", + "id": "reactflow__edge-TINYMOVR_CALIBRATE-0e6dc485-914a-4d63-b8d9-7e36270a365ddefault-TINYMOVR_BLDC-63bf870f-89c3-4366-bc09-d9e4ade5f29cdefault" + } + ], + "viewport": { + "x": 472.4845724041756, + "y": 354.12030268540553, + "zoom": 0.5269422050939508 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/TIC.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/TIC.md new file mode 100644 index 0000000000..a1c94ff619 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/TIC.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/docstring.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..edde653427 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/docstring.json @@ -0,0 +1,21 @@ +{ + "description": "The user defines the speed and the sleep time between movements.\n\n(To choose the position, use the STEPPER_DRIVER_TIC_KNOB.)", + "parameters": [ + { + "name": "current_limit", + "type": "int", + "description": "Defines the current limitation that the stepper motor will receive." + }, + { + "name": "sleep_time", + "type": "int", + "description": "Defines the sleep time after moving to each position." + }, + { + "name": "speed", + "type": "int", + "description": "Defines the speed of the motor movement (between 0 and 200000)." + } + ], + "returns": [] +} \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/docstring.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..cafc92d372 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The STEPPER_DRIVER_TIC node controls a stepper motor's movement with a TIC driver. + + The user defines the speed and the sleep time between movements. + + (To choose the position, use the STEPPER_DRIVER_TIC_KNOB.) + + Parameters + ---------- + current_limit : int + Defines the current limitation that the stepper motor will receive. + sleep_time : int + Defines the sleep time after moving to each position. + speed : int + Defines the speed of the motor movement (between 0 and 200000). diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/python_code.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..d2cfda5213 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/a1-[autogen]/python_code.txt @@ -0,0 +1,37 @@ +from flojoy import flojoy, OrderedPair +from typing import Optional +from ticlib import ( + TicUSB, +) # Import the TicUSB library to send command to Tic drivers with USB connection +from time import sleep + + +@flojoy(deps={"ticlib": "0.2.2"}) +def TIC( + default: Optional[OrderedPair] = None, + current_limit: int = 30, + sleep_time: int = 2, + speed: int = 100000, +) -> OrderedPair: + + + # Setting default positions + positions: list[int] = [50, 100, 150, 200] + + # Declaration of the stepper driver + tic: TicUSB = TicUSB() + tic.halt_and_set_position(0) # Set the position to 0 + # Set the current limit of the TIC driver + tic.set_current_limit(current_limit) + tic.energize() # Turn on the driver + tic.exit_safe_start() # The driver is now ready to receive commands + + for i in range(0, len(positions)): + tic.set_max_speed(speed) # Set motor speed + tic.set_target_position(positions[i]) # Set target positions + sleep(sleep_time) + + tic.deenergize() + tic.enter_safe_start() + + return OrderedPair(x=positions, y=positions) diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/hardware.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/media.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/notes.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/examples/EX1/app.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/examples/EX1/app.json new file mode 100644 index 0000000000..cdd50cdcb4 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/examples/EX1/app.json @@ -0,0 +1,84 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "STEPPER_DRIVER_TIC-deb4fca7-fc18-443d-bd70-f1455a749eff", + "type": "INSTRUMENTS", + "data": { + "id": "STEPPER_DRIVER_TIC-deb4fca7-fc18-443d-bd70-f1455a749eff", + "label": "STEPPER DRIVER TIC", + "func": "STEPPER_DRIVER_TIC", + "type": "INSTRUMENTS", + "ctrls": { + "current_limit": { + "type": "int", + "default": 30, + "functionName": "STEPPER_DRIVER_TIC", + "param": "current_limit", + "value": 30, + }, + "sleep_time": { + "type": "int", + "default": 2, + "functionName": "STEPPER_DRIVER_TIC", + "param": "sleep_time", + "value": 2, + }, + "speed": { + "type": "int", + "default": 100000, + "functionName": "STEPPER_DRIVER_TIC", + "param": "speed", + "value": 100000, + }, + }, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair", + "multiple": false, + } + ], + "outputs": [ + {"name": "default", "id": "default", "type": "OrderedPair"} + ], + "pip_dependencies": [{"name": "ticlib", "v": "0.2.2"}], + "path": "PYTHON/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.py", + "selected": false, + }, + "position": {"x": 883.1245033729516, "y": -2.309719518942927}, + "selected": false, + "positionAbsolute": {"x": 883.1245033729516, "y": -2.309719518942927}, + "dragging": true, + } + ], + "edges": [], + "viewport": { + "x": -358.59636577932724, + "y": 99.85117439980638, + "zoom": 1.0581352782820395, + }, + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER", + }, + } + ], +} diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/examples/EX1/example.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/examples/EX1/example.md new file mode 100644 index 0000000000..fc3caa95ec --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/examples/EX1/example.md @@ -0,0 +1,15 @@ +--- +title: STEPPER_DRIVER_TIC +description: This node controls a stepper motor movement with a TIC driver. The user defines the speed and the sleep time between movements. +keyword: [Python, Instrument, Stepper motor control, Python integration with stepper driver, Motion control and automation, Python"-"based stepper motor control, Stepper motor driver integration, Accurate motor movement with Python, Enhance motion control with Python, Streamline motor automation, Precise motor control using Python, Python control of stepper driver TIC] +image: https://raw.githubusercontent.com/flojoy-ai/docs/main/docs/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/output.jpeg +--- + +In this example, the [`STEPPER_DRIVER_TIC`](https://github.com/flojoy-io/nodes/blob/main/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.py) node controls a stepper motor movement with a TIC driver. + +First, the user must define the current limitation, which depends on the motor's size and model. +After that, he can set the speed and choose the sleep time between movements. + +Then, after clicking the PLAY button, the motor will move between the four default positions. (To choose positions, use the [`STEPPER_DRIVER_TIC_KNOB`](https://github.com/flojoy-io/nodes/blob/main/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/STEPPER_DRIVER_TIC_KNOB.py) node.) + +To create a repetitive movement, use the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/TIC_KNOB.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/TIC_KNOB.md new file mode 100644 index 0000000000..cd7a13541c --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/TIC_KNOB.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/docstring.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..73ef385bb6 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/docstring.json @@ -0,0 +1,26 @@ +{ + "description": "The user controls the motor's rotation with the knob position, specified in the node's parameters.", + "parameters": [ + { + "name": "knob_value", + "type": "int", + "description": "Defines the position of the motor (rotational movement)." + }, + { + "name": "current_limit", + "type": "int", + "description": "Defines the current limitation that the stepper motor will receive." + }, + { + "name": "sleep_time", + "type": "int", + "description": "Defines the sleep time after moving to each position." + }, + { + "name": "speed", + "type": "int", + "description": "Defines the speed of the motor movement (between 0 and 200000)." + } + ], + "returns": [] +} \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/docstring.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..529afb278b --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The STEPPER_DRIVER_TIC_KNOB controls a stepper motor's movement with a TIC driver. + + The user controls the motor's rotation with the knob position, specified in the node's parameters. + + Parameters + ---------- + knob_value : int + Defines the position of the motor (rotational movement). + current_limit : int + Defines the current limitation that the stepper motor will receive. + sleep_time : int + Defines the sleep time after moving to each position. + speed : int + Defines the speed of the motor movement (between 0 and 200000). diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/python_code.txt b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..2f98079318 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/a1-[autogen]/python_code.txt @@ -0,0 +1,41 @@ +from flojoy import flojoy, OrderedPair +from typing import Optional + +# Import the TicUSB library to send command to Tic drivers with USB connection +from ticlib import TicUSB +from time import sleep + + +@flojoy(deps={"ticlib": "0.2.2"}) +def TIC_KNOB( + default: Optional[OrderedPair] = None, + knob_value: int = 0, + current_limit: int = 30, + sleep_time: int = 2, + speed: int = 200000, +) -> OrderedPair: + + + # Converting the knob value into a position + knob_position: int = 2 * knob_value + + # Declaration of the stepper driver (You can add serial number to specify the driver) + tic: TicUSB = TicUSB() + # Set the current limit for the driver TIC + tic.set_current_limit(current_limit) + tic.energize() # Turn on the driver + tic.exit_safe_start() # The driver is now ready to receive commands + # Set maximum speed for the motor during first movement. + tic.set_max_speed(speed) + + tic.halt_and_set_position(0) # Set initial position to origin + sleep(sleep_time) + + # Set target position for the first movement + tic.set_target_position(knob_position) + sleep(sleep_time) + + tic.deenergize() + tic.enter_safe_start() + + return OrderedPair(x=knob_position, y=speed) diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/hardware.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/media.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/notes.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/examples/EX1/app.json b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/examples/EX1/app.json new file mode 100644 index 0000000000..e0a12da8f6 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/examples/EX1/app.json @@ -0,0 +1,106 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "STEPPER_DRIVER_TIC_KNOB-3b234e79-4648-4661-a8e8-3e14b3d0e72b", + "type": "INSTRUMENTS", + "data": { + "id": "STEPPER_DRIVER_TIC_KNOB-3b234e79-4648-4661-a8e8-3e14b3d0e72b", + "label": "STEPPER DRIVER TIC KNOB", + "func": "STEPPER_DRIVER_TIC_KNOB", + "type": "INSTRUMENTS", + "ctrls": { + "knob_value": { + "type": "int", + "default": 0, + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "knob_value", + "value": 0 + }, + "current_limit": { + "type": "int", + "default": 30, + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "current_limit", + "value": 30 + }, + "sleep_time": { + "type": "int", + "default": 2, + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "sleep_time", + "value": 2 + }, + "speed": { + "type": "int", + "default": 200000, + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "speed", + "value": 200000 + } + }, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair", + "multiple": false + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair" + } + ], + "pip_dependencies": [ + { + "name": "ticlib", + "v": "0.2.2" + } + ], + "path": "PYTHON/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/STEPPER_DRIVER_TIC_KNOB.py", + "selected": false + }, + "position": { + "x": 934.1949826356821, + "y": -1.452956731347598 + }, + "selected": false, + "positionAbsolute": { + "x": 934.1949826356821, + "y": -1.452956731347598 + }, + "dragging": true + } + ], + "edges": [], + "viewport": { + "x": -358.59636577932724, + "y": 99.85117439980638, + "zoom": 1.0581352782820395 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/examples/EX1/example.md b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/examples/EX1/example.md new file mode 100644 index 0000000000..fdb3688444 --- /dev/null +++ b/docs/nodes/IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC_KNOB/examples/EX1/example.md @@ -0,0 +1,14 @@ +--- +title: STEPPER_DRIVER_TIC_KNOB +description: In this example, the STEPPER_DRIVER_TIC_KNOB node controls a stepper motor movement with a TIC driver. It allows you to control the motor's rotation with a KNOB button. From 0 to 100 corresponds to a rotation between 0 and 360 degrees. +keyword: [Python, Instrument, Stepper motor control with knob, Python integration with stepper driver, Motion control and automation, Python"-"based stepper motor control, Stepper motor driver integration, Accurate motor movement with Python, Enhance motion control with knob, Streamline motor automation, Precise motor control using Python, Python control of stepper driver TIC with knob] +image: https://raw.githubusercontent.com/flojoy-ai/docs/main/docs/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/output.jpeg +--- + +In this example, the [`STEPPER_DRIVER_TIC_KNOB`](https://github.com/flojoy-io/nodes/blob/main/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/STEPPER_DRIVER_TIC_KNOB.py) node controls a stepper motor movement with a TIC driver. It allows you to control the motor's rotation with a KNOB button. (From 0 to 100 corresponds to a rotation between 0 and 360 degrees.) + +First, the user must define the current limitation, which depends on the motor's size and model. After that, he can set the speed, the rotation, and the sleep time to create a specific movement for different applications. Then, after clicking the PLAY button, the motor will start moving. + +After updating the knob position, click on PLAY again to initiate a new movement. + +To create a repetitive movement, use the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) and [`GOTO`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/GOTO/GOTO.py) nodes. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/CAN_MESSAGE.md b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/CAN_MESSAGE.md new file mode 100644 index 0000000000..0da9623050 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/CAN_MESSAGE.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..fd39de3d49 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.json @@ -0,0 +1,22 @@ +{ + "description": "Inputs\n------\nmessage : Vector\n The array of data to send to the CAN bus.", + "parameters": [ + { + "name": "arbitration_id", + "type": "int", + "description": "Unique ID for message being sent." + }, + { + "name": "is_extended_id", + "type": "bool", + "description": "Flag that controls the size of the arbitration_id field." + } + ], + "returns": [ + { + "name": null, + "type": "Textblob", + "description": "Traceback error" + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e0ac0e29f4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.txt @@ -0,0 +1,18 @@ +The CAN_MESSAGE node sends a message onto CAN network through a slcan-compatible USB-to-CAN adapter. + + Inputs + ------ + message : Vector + The array of data to send to the CAN bus. + + Parameters + ---------- + arbitration_id : int + Unique ID for message being sent. + is_extended_id : bool + Flag that controls the size of the arbitration_id field. + + Returns + ------- + Textblob + Traceback error diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..37511d7ed9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/python_code.txt @@ -0,0 +1,33 @@ +import can, traceback, json +from can.interface import Bus +from flojoy import flojoy, SerialDevice, Vector, DataContainer, TextBlob +from typing import Optional + + +@flojoy(deps={"python-can": "4.2.2"}) +def CAN_MESSAGE( + device: SerialDevice, + message: Vector | Optional[DataContainer] = None, + # arbitration_id: hex = 0xC0FFEE, TODO: Support hex inputs + is_extended_id: bool = True, +) -> TextBlob: + + + s = "" + try: + can.rc["interface"] = "slcan" + can.rc["channel"] = device.get_port() + can.rc["bitrate"] = 500000 + + s = json.dumps(can.rc) + + msg = can.Message( + data=message.v, arbitration_id=0xC0FFEE, is_extended_id=is_extended_id + ) + + with can.Bus() as bus: + bus.send(msg) + except: + s = traceback.format_exc() + + return TextBlob(s) diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/hardware.md b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/media.md b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/notes.md b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/examples/EX1/app.json b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/examples/EX1/app.json new file mode 100644 index 0000000000..7d60615ae6 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/examples/EX1/app.json @@ -0,0 +1,371 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 208, + "height": 96, + "id": "LINSPACE-dce33fe2-cceb-4cd2-b00d-50e5b4942258", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-dce33fe2-cceb-4cd2-b00d-50e5b4942258", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 10 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 0 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 1000 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between 'start' and 'end' with a 'step' number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -490.3172690460911, + "y": 170.92783037044398 + }, + "selected": false, + "positionAbsolute": { + "x": -490.3172690460911, + "y": 170.92783037044398 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "SINE-e06b3928-3c41-41e4-aa1b-e720334a90ed", + "type": "GENERATORS", + "data": { + "id": "SINE-e06b3928-3c41-41e4-aa1b-e720334a90ed", + "label": "SINE", + "func": "SINE", + "type": "GENERATORS", + "ctrls": { + "amplitude": { + "type": "float", + "default": 1, + "desc": "The amplitude of the wave.", + "overload": null, + "functionName": "SINE", + "param": "amplitude", + "value": 1 + }, + "frequency": { + "type": "float", + "default": 1, + "desc": "The wave frequency in radians/2pi.", + "overload": null, + "functionName": "SINE", + "param": "frequency", + "value": 1 + }, + "offset": { + "type": "float", + "default": 0, + "desc": "The y axis offset of the function.", + "overload": null, + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "phase": { + "type": "float", + "default": 0, + "desc": "The x axis offset of the function.", + "overload": null, + "functionName": "SINE", + "param": "phase", + "value": 0 + }, + "waveform": { + "type": "select", + "options": [ + "sine", + "square", + "triangle", + "sawtooth" + ], + "default": "sine", + "desc": "The waveform type of the wave.", + "overload": null, + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Vector", + "multiple": false, + "desc": "Input that defines the x-axis values of the function and output." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair", + "desc": "x: the input v or x values\ny: the resulting sine function" + } + ], + "path": "GENERATORS/SIMULATIONS/SINE/SINE.py", + "selected": false + }, + "position": { + "x": -164.1551642060792, + "y": 174.9523731173573 + }, + "selected": false, + "positionAbsolute": { + "x": -164.1551642060792, + "y": 174.9523731173573 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "ORDERED_PAIR_2_VECTOR-21ddfb7d-aa19-464b-8bb3-051d9fe14191", + "type": "TRANSFORMERS", + "data": { + "id": "ORDERED_PAIR_2_VECTOR-21ddfb7d-aa19-464b-8bb3-051d9fe14191", + "label": "ORDERED PAIR 2 VECTOR", + "func": "ORDERED_PAIR_2_VECTOR", + "type": "TRANSFORMERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair", + "multiple": false, + "desc": "The input OrderedPair." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The y component of the input OrderedPair." + } + ], + "path": "TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/ORDERED_PAIR_2_VECTOR.py", + "selected": false + }, + "position": { + "x": 197.1756233375782, + "y": 143.01804479213024 + }, + "selected": false, + "positionAbsolute": { + "x": 197.1756233375782, + "y": 143.01804479213024 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "CAN_MESSAGE-71a4141b-bd9e-44ae-9242-68da2cbc5288", + "type": "IO", + "data": { + "id": "CAN_MESSAGE-71a4141b-bd9e-44ae-9242-68da2cbc5288", + "label": "CAN MESSAGE", + "func": "CAN_MESSAGE", + "type": "IO", + "ctrls": { + "device": { + "type": "SerialDevice", + "default": null, + "desc": null, + "overload": null, + "functionName": "CAN_MESSAGE", + "param": "device", + "value": "/dev/cu.usbmodem83301" + }, + "is_extended_id": { + "type": "bool", + "default": true, + "desc": "Flag that controls the size of the arbitration_id field.", + "overload": null, + "functionName": "CAN_MESSAGE", + "param": "is_extended_id", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "The array of data to send to the CAN bus." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": null + } + ], + "pip_dependencies": [ + { + "name": "python-can", + "v": "4.2.2" + } + ], + "path": "IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/CAN_MESSAGE.py", + "selected": false + }, + "position": { + "x": 496.25163839325535, + "y": 125.43953499605306 + }, + "selected": false, + "positionAbsolute": { + "x": 496.25163839325535, + "y": 125.43953499605306 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-19bd940d-530f-4338-acb7-6cc6c882f128", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-19bd940d-530f-4338-acb7-6cc6c882f128", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 864.489149851756, + "y": 109.75673583512685 + }, + "selected": false, + "positionAbsolute": { + "x": 864.489149851756, + "y": 109.75673583512685 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CAN_MESSAGE-71a4141b-bd9e-44ae-9242-68da2cbc5288", + "sourceHandle": "default", + "target": "TEXT_VIEW-19bd940d-530f-4338-acb7-6cc6c882f128", + "targetHandle": "default", + "id": "reactflow__edge-CAN_MESSAGE-71a4141b-bd9e-44ae-9242-68da2cbc5288default-TEXT_VIEW-19bd940d-530f-4338-acb7-6cc6c882f128default" + }, + { + "source": "ORDERED_PAIR_2_VECTOR-21ddfb7d-aa19-464b-8bb3-051d9fe14191", + "sourceHandle": "default", + "target": "CAN_MESSAGE-71a4141b-bd9e-44ae-9242-68da2cbc5288", + "targetHandle": "default", + "id": "reactflow__edge-ORDERED_PAIR_2_VECTOR-21ddfb7d-aa19-464b-8bb3-051d9fe14191default-CAN_MESSAGE-71a4141b-bd9e-44ae-9242-68da2cbc5288default" + }, + { + "source": "LINSPACE-dce33fe2-cceb-4cd2-b00d-50e5b4942258", + "sourceHandle": "default", + "target": "SINE-e06b3928-3c41-41e4-aa1b-e720334a90ed", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-dce33fe2-cceb-4cd2-b00d-50e5b4942258default-SINE-e06b3928-3c41-41e4-aa1b-e720334a90eddefault" + }, + { + "source": "SINE-e06b3928-3c41-41e4-aa1b-e720334a90ed", + "sourceHandle": "default", + "target": "ORDERED_PAIR_2_VECTOR-21ddfb7d-aa19-464b-8bb3-051d9fe14191", + "targetHandle": "default", + "id": "reactflow__edge-SINE-e06b3928-3c41-41e4-aa1b-e720334a90eddefault-ORDERED_PAIR_2_VECTOR-21ddfb7d-aa19-464b-8bb3-051d9fe14191default" + } + ], + "viewport": { + "x": 545.2070297985838, + "y": 336.1216320824366, + "zoom": 0.5 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/PROLOGIX_ADDR.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/PROLOGIX_ADDR.md new file mode 100644 index 0000000000..a69e055a9d --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/PROLOGIX_ADDR.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..be02d32e53 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": "Inputs\n------\ndefault: DataContainer\n Any DataContainer - likely connected to the output of the OPEN_SERIAL node.", + "parameters": [ + { + "name": "connection", + "type": "Serial", + "description": "The open serial connection with the instrument." + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": "Response from the Prologix USB-to-GPIB controller." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..0a108c9064 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.txt @@ -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. diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..9bd9170d1c --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/python_code.txt @@ -0,0 +1,26 @@ +import serial +import traceback +from flojoy import flojoy, SerialConnection, DataContainer, TextBlob +from typing import cast, Optional + + +@flojoy(deps={"pyserial": "3.5"}, inject_connection=True) +def PROLOGIX_ADDR( + connection: SerialConnection, + default: Optional[DataContainer] = None, + addr: int = 22, +) -> TextBlob: + + + # Start serial communication with the instrument + ser = cast(serial.Serial, connection.get_handle()) + + if ser is None: + raise ValueError("Serial communication is not open") + + cmd = "++addr " + str(addr) + "\r\n" + ser.write(cmd.encode()) + + s = ser.read(256) + + return TextBlob(s) diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/hardware.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/media.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/notes.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/examples/EX1/app.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/examples/EX1/app.json new file mode 100644 index 0000000000..c9e48d4719 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/examples/EX1/app.json @@ -0,0 +1,636 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "type": "IO", + "data": { + "id": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "label": "OPEN SERIAL", + "func": "OPEN_SERIAL", + "type": "IO", + "ctrls": { + "device": { + "type": "SerialDevice", + "default": null, + "desc": "The connected serial device.", + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "device", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "baudrate": { + "type": "int", + "default": 9600, + "desc": null, + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "baudrate", + "value": 9600 + } + }, + "initCtrls": {}, + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": null + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL.py", + "selected": false + }, + "position": { + "x": -628.3695500442519, + "y": -130.0833366506728 + }, + "selected": false, + "positionAbsolute": { + "x": -628.3695500442519, + "y": -130.0833366506728 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "type": "IO", + "data": { + "id": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "label": "PROLOGIX AUTO", + "func": "PROLOGIX_AUTO", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_AUTO", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "auto": { + "type": "select", + "options": [ + "On", + "Off", + "Current state" + ], + "default": "Current state", + "desc": null, + "overload": null, + "functionName": "PROLOGIX_AUTO", + "param": "auto", + "value": "Current state" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/PROLOGIX_AUTO.py", + "selected": false + }, + "position": { + "x": -291.01330554393314, + "y": 141.21176512962404 + }, + "selected": false, + "positionAbsolute": { + "x": -291.01330554393314, + "y": 141.21176512962404 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "type": "IO", + "data": { + "id": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "label": "PROLOGIX ADDR", + "func": "PROLOGIX_ADDR", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_ADDR", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "addr": { + "type": "int", + "default": 22, + "desc": null, + "overload": null, + "functionName": "PROLOGIX_ADDR", + "param": "addr", + "value": 22 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/PROLOGIX_ADDR.py", + "selected": false + }, + "position": { + "x": -296.8867855429962, + "y": -127.35186275581793 + }, + "selected": false, + "positionAbsolute": { + "x": -296.8867855429962, + "y": -127.35186275581793 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "type": "IO", + "data": { + "id": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "label": "PROLOGIX MODE", + "func": "PROLOGIX_MODE", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_MODE", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "mode": { + "type": "select", + "options": [ + "CONTROLLER", + "DEVICE" + ], + "default": "CONTROLLER", + "desc": null, + "overload": null, + "functionName": "PROLOGIX_MODE", + "param": "mode", + "value": "CONTROLLER" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/PROLOGIX_MODE.py", + "selected": false + }, + "position": { + "x": -299.16744190685495, + "y": -399.5041112278735 + }, + "selected": false, + "positionAbsolute": { + "x": -299.16744190685495, + "y": -399.5041112278735 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "label": "PRINT DATACONTAINER", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": true + }, + "position": { + "x": 9.534992068056255, + "y": 158.93742789390558 + }, + "selected": true, + "positionAbsolute": { + "x": 9.534992068056255, + "y": 158.93742789390558 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "label": "PRINT DATACONTAINER 1", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 9.069179875222915, + "y": -111.77518944899901 + }, + "selected": false, + "positionAbsolute": { + "x": 9.069179875222915, + "y": -111.77518944899901 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "label": "PRINT DATACONTAINER 2", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 8.862712458982685, + "y": -383.3113942703777 + }, + "selected": false, + "positionAbsolute": { + "x": 8.862712458982685, + "y": -383.3113942703777 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 435.3382469911546, + "y": 175.17006923996496 + }, + "selected": false, + "positionAbsolute": { + "x": 435.3382469911546, + "y": 175.17006923996496 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "label": "TEXT VIEW 1", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 422.36257845690176, + "y": -147.93370633164506 + }, + "selected": false, + "positionAbsolute": { + "x": 422.36257845690176, + "y": -147.93370633164506 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "label": "TEXT VIEW 2", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 416.3847981136062, + "y": -484.9274809881268 + }, + "selected": false, + "positionAbsolute": { + "x": 416.3847981136062, + "y": -484.9274809881268 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694ddefault" + }, + { + "source": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6ebdefault-PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138adefault" + }, + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6ebdefault" + }, + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5dbdefault" + }, + { + "source": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694ddefault-PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930ddefault" + }, + { + "source": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5dbdefault-PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855fdefault" + }, + { + "source": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "sourceHandle": "default", + "target": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138adefault-TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bcdefault" + }, + { + "source": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "sourceHandle": "default", + "target": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930ddefault-TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3default" + }, + { + "source": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "sourceHandle": "default", + "target": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855fdefault-TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9default" + } + ], + "viewport": { + "x": 531.2578257632742, + "y": 458.93935293704044, + "zoom": 0.5 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/PROLOGIX_AUTO.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/PROLOGIX_AUTO.md new file mode 100644 index 0000000000..d08003292b --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/PROLOGIX_AUTO.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..f6d05ea8f8 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": "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.\n\nInputs\n------\ndefault: DataContainer\n Any DataContainer - likely connected to the output of the OPEN_SERIAL node.", + "parameters": [ + { + "name": "connection", + "type": "Serial", + "description": "The open serial connection with the instrument." + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": "Response from the Prologix USB-to-GPIB controller." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..bc574fa77e --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.txt @@ -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. diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..84db914d8c --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/python_code.txt @@ -0,0 +1,31 @@ +import serial +from flojoy import flojoy, SerialConnection, DataContainer, TextBlob +from typing import cast, Optional, Literal + + +@flojoy(deps={"pyserial": "3.5"}, inject_connection=True) +def PROLOGIX_AUTO( + connection: SerialConnection, + default: Optional[DataContainer] = None, + auto: Literal["On", "Off", "Current state"] = "Current state", +) -> TextBlob: + + + # Start serial communication with the instrument + ser = cast(serial.Serial, connection.get_handle()) + + if ser is None: + raise ValueError("Serial communication is not open") + + auto_integer = 0 + if auto == "Current state": + ser.write(b"++auto\r\n") + elif auto == "On": + auto_integer = 1 + else: + cmd = "++auto " + str(auto_integer) + "\r\n" + ser.write(cmd.encode()) + + s = ser.read(256) + + return TextBlob(s) diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/hardware.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/media.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/notes.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/examples/EX1/app.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/examples/EX1/app.json new file mode 100644 index 0000000000..c9e48d4719 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/examples/EX1/app.json @@ -0,0 +1,636 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "type": "IO", + "data": { + "id": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "label": "OPEN SERIAL", + "func": "OPEN_SERIAL", + "type": "IO", + "ctrls": { + "device": { + "type": "SerialDevice", + "default": null, + "desc": "The connected serial device.", + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "device", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "baudrate": { + "type": "int", + "default": 9600, + "desc": null, + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "baudrate", + "value": 9600 + } + }, + "initCtrls": {}, + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": null + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL.py", + "selected": false + }, + "position": { + "x": -628.3695500442519, + "y": -130.0833366506728 + }, + "selected": false, + "positionAbsolute": { + "x": -628.3695500442519, + "y": -130.0833366506728 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "type": "IO", + "data": { + "id": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "label": "PROLOGIX AUTO", + "func": "PROLOGIX_AUTO", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_AUTO", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "auto": { + "type": "select", + "options": [ + "On", + "Off", + "Current state" + ], + "default": "Current state", + "desc": null, + "overload": null, + "functionName": "PROLOGIX_AUTO", + "param": "auto", + "value": "Current state" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/PROLOGIX_AUTO.py", + "selected": false + }, + "position": { + "x": -291.01330554393314, + "y": 141.21176512962404 + }, + "selected": false, + "positionAbsolute": { + "x": -291.01330554393314, + "y": 141.21176512962404 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "type": "IO", + "data": { + "id": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "label": "PROLOGIX ADDR", + "func": "PROLOGIX_ADDR", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_ADDR", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "addr": { + "type": "int", + "default": 22, + "desc": null, + "overload": null, + "functionName": "PROLOGIX_ADDR", + "param": "addr", + "value": 22 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/PROLOGIX_ADDR.py", + "selected": false + }, + "position": { + "x": -296.8867855429962, + "y": -127.35186275581793 + }, + "selected": false, + "positionAbsolute": { + "x": -296.8867855429962, + "y": -127.35186275581793 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "type": "IO", + "data": { + "id": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "label": "PROLOGIX MODE", + "func": "PROLOGIX_MODE", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_MODE", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "mode": { + "type": "select", + "options": [ + "CONTROLLER", + "DEVICE" + ], + "default": "CONTROLLER", + "desc": null, + "overload": null, + "functionName": "PROLOGIX_MODE", + "param": "mode", + "value": "CONTROLLER" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/PROLOGIX_MODE.py", + "selected": false + }, + "position": { + "x": -299.16744190685495, + "y": -399.5041112278735 + }, + "selected": false, + "positionAbsolute": { + "x": -299.16744190685495, + "y": -399.5041112278735 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "label": "PRINT DATACONTAINER", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": true + }, + "position": { + "x": 9.534992068056255, + "y": 158.93742789390558 + }, + "selected": true, + "positionAbsolute": { + "x": 9.534992068056255, + "y": 158.93742789390558 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "label": "PRINT DATACONTAINER 1", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 9.069179875222915, + "y": -111.77518944899901 + }, + "selected": false, + "positionAbsolute": { + "x": 9.069179875222915, + "y": -111.77518944899901 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "label": "PRINT DATACONTAINER 2", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 8.862712458982685, + "y": -383.3113942703777 + }, + "selected": false, + "positionAbsolute": { + "x": 8.862712458982685, + "y": -383.3113942703777 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 435.3382469911546, + "y": 175.17006923996496 + }, + "selected": false, + "positionAbsolute": { + "x": 435.3382469911546, + "y": 175.17006923996496 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "label": "TEXT VIEW 1", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 422.36257845690176, + "y": -147.93370633164506 + }, + "selected": false, + "positionAbsolute": { + "x": 422.36257845690176, + "y": -147.93370633164506 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "label": "TEXT VIEW 2", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 416.3847981136062, + "y": -484.9274809881268 + }, + "selected": false, + "positionAbsolute": { + "x": 416.3847981136062, + "y": -484.9274809881268 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694ddefault" + }, + { + "source": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6ebdefault-PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138adefault" + }, + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6ebdefault" + }, + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5dbdefault" + }, + { + "source": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694ddefault-PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930ddefault" + }, + { + "source": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5dbdefault-PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855fdefault" + }, + { + "source": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "sourceHandle": "default", + "target": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138adefault-TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bcdefault" + }, + { + "source": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "sourceHandle": "default", + "target": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930ddefault-TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3default" + }, + { + "source": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "sourceHandle": "default", + "target": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855fdefault-TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9default" + } + ], + "viewport": { + "x": 531.2578257632742, + "y": 458.93935293704044, + "zoom": 0.5 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/PROLOGIX_HELP.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/PROLOGIX_HELP.md new file mode 100644 index 0000000000..96a8c148d5 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/PROLOGIX_HELP.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..c265093856 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": "Inputs\n------\ndefault: DataContainer\n Any DataContainer - likely connected to the output of the OPEN_SERIAL node.", + "parameters": [ + { + "name": "connection", + "type": "Serial", + "description": "The open serial connection with the instrument." + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": "A list of available Prologix USB-to-GPIB firmware commands" + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..0e48a32202 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.txt @@ -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 diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..e1094c6d18 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/python_code.txt @@ -0,0 +1,23 @@ +import serial, traceback +from flojoy import flojoy, SerialConnection, TextBlob, DataContainer +from typing import cast, Optional + + +@flojoy(deps={"pyserial": "3.5"}, inject_connection=True) +def PROLOGIX_HELP( + connection: SerialConnection, + default: Optional[DataContainer] = None, +) -> TextBlob: + + + try: + # Start serial communication with the instrument + ser = cast(serial.Serial, connection.get_handle()) + if ser is None: + raise ValueError("Serial communication is not open") + ser.write(b"++help\r\n") + s = ser.read(1000).decode() + except: + s = traceback.format_exc() + + return TextBlob(s) diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/hardware.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/media.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/notes.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/examples/EX1/app.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/examples/EX1/app.json new file mode 100644 index 0000000000..19669d125e --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/examples/EX1/app.json @@ -0,0 +1,324 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "type": "IO", + "data": { + "id": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "label": "OPEN SERIAL", + "func": "OPEN_SERIAL", + "type": "IO", + "ctrls": { + "device": { + "type": "SerialDevice", + "default": null, + "desc": "The connected serial device.", + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "device", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "baudrate": { + "type": "int", + "default": 9600, + "desc": null, + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "baudrate", + "value": 9600 + } + }, + "initCtrls": {}, + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": null + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL.py", + "selected": false + }, + "position": { + "x": -409.7072613691855, + "y": -119.46721173101321 + }, + "selected": false, + "positionAbsolute": { + "x": -409.7072613691855, + "y": -119.46721173101321 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "type": "IO", + "data": { + "id": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "label": "PROLOGIX HELP", + "func": "PROLOGIX_HELP", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_HELP", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "A list of available Prologix USB-to-GPIB firmware commands" + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/PROLOGIX_HELP.py", + "selected": false + }, + "position": { + "x": 43.7677951992148, + "y": -301.62936069100147 + }, + "selected": false, + "positionAbsolute": { + "x": 43.7677951992148, + "y": -301.62936069100147 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": true, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 423.4185766491661, + "y": -355.54847177565506 + }, + "selected": false, + "positionAbsolute": { + "x": 423.4185766491661, + "y": -355.54847177565506 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "type": "IO", + "data": { + "id": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "label": "PROLOGIX VER", + "func": "PROLOGIX_VER", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_VER", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The Prologix controller available commands." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/PROLOGIX_VER.py", + "selected": false + }, + "position": { + "x": 36.97386338103118, + "y": 100.85210674163193 + }, + "selected": false, + "positionAbsolute": { + "x": 36.97386338103118, + "y": 100.85210674163193 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37", + "label": "TEXT VIEW 1", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 434.2592704786502, + "y": 53.58359116674569 + }, + "selected": false, + "positionAbsolute": { + "x": 434.2592704786502, + "y": 53.58359116674569 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "sourceHandle": "default", + "target": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231default-PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4default" + }, + { + "source": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "sourceHandle": "default", + "target": "TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4default-TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567default" + }, + { + "source": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "sourceHandle": "default", + "target": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231default-PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98default" + }, + { + "source": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "sourceHandle": "default", + "target": "TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98default-TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37default" + } + ], + "viewport": { + "x": 466.68096270497455, + "y": 429.1170430912722, + "zoom": 0.5180199090230052 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/PROLOGIX_MODE.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/PROLOGIX_MODE.md new file mode 100644 index 0000000000..ff712d136d --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/PROLOGIX_MODE.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..6dcea3157e --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": "From the Prologix manual:\n\nIn Controller mode, the GPIB-USB Controller acts as the Controller-In-Charge (CIC)\non the GPIB bus. When the controller receives a command over the USB port\nterminated by the USB terminator \u2013 CR (ASCII 13) or LF (ASCII 10) \u2013 it addresses the\nGPIB instrument at the currently specified address (See ++addr command) to listen, and\npasses along the received data.\n\nIn Device mode, Prologix GPIB-USB Controller acts as another peripheral on the GPIB\nbus. In this mode, the controller can act as a GPIB TALKER or GPIB LISTENER\nonly. Since Prologix GPIB-USB Controller is not the Controller-In-Charge while in this\nmode, it expects to receive commands from a GPIB controller. When Device mode is\nenabled Prologix GPIB-USB controller configures itself as a GPIB Listener. All data\nreceived by the controller over the GPIB port is passed along to the USB port without\nbuffering.\n\nInputs\n------\ndefault: DataContainer\n Any DataContainer - likely connected to the output of the OPEN_SERIAL node.", + "parameters": [ + { + "name": "connection", + "type": "Serial", + "description": "The open serial connection with the instrument." + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": "Response from the Prologix USB-to-GPIB controller." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..6bc0265178 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.txt @@ -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. diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..f259322cfc --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/python_code.txt @@ -0,0 +1,30 @@ +import serial +import traceback +from flojoy import flojoy, SerialConnection, DataContainer, TextBlob +from typing import cast, Optional, Literal + + +@flojoy(deps={"pyserial": "3.5"}, inject_connection=True) +def PROLOGIX_MODE( + connection: SerialConnection, + default: Optional[DataContainer] = None, + mode: Literal["CONTROLLER", "DEVICE"] = "CONTROLLER", +) -> TextBlob: + + + # Start serial communication with the instrument + ser = cast(serial.Serial, connection.get_handle()) + + if ser is None: + raise ValueError("Serial communication is not open") + + mode_integer = 0 + if mode == "CONTROLLER": + mode_integer = 1 + + cmd = "++mode " + str(mode_integer) + "\r\n" + ser.write(cmd.encode()) + + s = ser.read(256) + + return TextBlob(s) diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/hardware.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/media.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/notes.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/examples/EX1/app.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/examples/EX1/app.json new file mode 100644 index 0000000000..c9e48d4719 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/examples/EX1/app.json @@ -0,0 +1,636 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "type": "IO", + "data": { + "id": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "label": "OPEN SERIAL", + "func": "OPEN_SERIAL", + "type": "IO", + "ctrls": { + "device": { + "type": "SerialDevice", + "default": null, + "desc": "The connected serial device.", + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "device", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "baudrate": { + "type": "int", + "default": 9600, + "desc": null, + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "baudrate", + "value": 9600 + } + }, + "initCtrls": {}, + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": null + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL.py", + "selected": false + }, + "position": { + "x": -628.3695500442519, + "y": -130.0833366506728 + }, + "selected": false, + "positionAbsolute": { + "x": -628.3695500442519, + "y": -130.0833366506728 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "type": "IO", + "data": { + "id": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "label": "PROLOGIX AUTO", + "func": "PROLOGIX_AUTO", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_AUTO", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "auto": { + "type": "select", + "options": [ + "On", + "Off", + "Current state" + ], + "default": "Current state", + "desc": null, + "overload": null, + "functionName": "PROLOGIX_AUTO", + "param": "auto", + "value": "Current state" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/PROLOGIX_AUTO.py", + "selected": false + }, + "position": { + "x": -291.01330554393314, + "y": 141.21176512962404 + }, + "selected": false, + "positionAbsolute": { + "x": -291.01330554393314, + "y": 141.21176512962404 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "type": "IO", + "data": { + "id": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "label": "PROLOGIX ADDR", + "func": "PROLOGIX_ADDR", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_ADDR", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "addr": { + "type": "int", + "default": 22, + "desc": null, + "overload": null, + "functionName": "PROLOGIX_ADDR", + "param": "addr", + "value": 22 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/PROLOGIX_ADDR.py", + "selected": false + }, + "position": { + "x": -296.8867855429962, + "y": -127.35186275581793 + }, + "selected": false, + "positionAbsolute": { + "x": -296.8867855429962, + "y": -127.35186275581793 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "type": "IO", + "data": { + "id": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "label": "PROLOGIX MODE", + "func": "PROLOGIX_MODE", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_MODE", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "mode": { + "type": "select", + "options": [ + "CONTROLLER", + "DEVICE" + ], + "default": "CONTROLLER", + "desc": null, + "overload": null, + "functionName": "PROLOGIX_MODE", + "param": "mode", + "value": "CONTROLLER" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "Response from the Prologix USB-to-GPIB controller." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/PROLOGIX_MODE.py", + "selected": false + }, + "position": { + "x": -299.16744190685495, + "y": -399.5041112278735 + }, + "selected": false, + "positionAbsolute": { + "x": -299.16744190685495, + "y": -399.5041112278735 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "label": "PRINT DATACONTAINER", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": true + }, + "position": { + "x": 9.534992068056255, + "y": 158.93742789390558 + }, + "selected": true, + "positionAbsolute": { + "x": 9.534992068056255, + "y": 158.93742789390558 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "label": "PRINT DATACONTAINER 1", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 9.069179875222915, + "y": -111.77518944899901 + }, + "selected": false, + "positionAbsolute": { + "x": 9.069179875222915, + "y": -111.77518944899901 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "label": "PRINT DATACONTAINER 2", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 8.862712458982685, + "y": -383.3113942703777 + }, + "selected": false, + "positionAbsolute": { + "x": 8.862712458982685, + "y": -383.3113942703777 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 435.3382469911546, + "y": 175.17006923996496 + }, + "selected": false, + "positionAbsolute": { + "x": 435.3382469911546, + "y": 175.17006923996496 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "label": "TEXT VIEW 1", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 422.36257845690176, + "y": -147.93370633164506 + }, + "selected": false, + "positionAbsolute": { + "x": 422.36257845690176, + "y": -147.93370633164506 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "label": "TEXT VIEW 2", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 416.3847981136062, + "y": -484.9274809881268 + }, + "selected": false, + "positionAbsolute": { + "x": 416.3847981136062, + "y": -484.9274809881268 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694ddefault" + }, + { + "source": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6ebdefault-PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138adefault" + }, + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6eb", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_MODE-12977206-e963-47e7-85be-358235fee6ebdefault" + }, + { + "source": "OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dce", + "sourceHandle": "default", + "target": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-e1fcb395-9071-48b5-9ad9-f79cb4f72dcedefault-PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5dbdefault" + }, + { + "source": "PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694d", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_ADDR-98c87b2a-b1c9-4b19-9caf-c51cc775694ddefault-PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930ddefault" + }, + { + "source": "PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5db", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_AUTO-64c0f1cb-a181-42a1-a921-9e97066ae5dbdefault-PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855fdefault" + }, + { + "source": "PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138a", + "sourceHandle": "default", + "target": "TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bc", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-79a4affd-e9b5-4aef-a383-7d9bdc20138adefault-TEXT_VIEW-005157b9-74d6-464a-abdb-47694b7017bcdefault" + }, + { + "source": "PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930d", + "sourceHandle": "default", + "target": "TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-705faa47-4605-422d-b862-2a215836930ddefault-TEXT_VIEW-9306fdc7-f2d1-4650-a386-ad3ebe9fb1c3default" + }, + { + "source": "PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855f", + "sourceHandle": "default", + "target": "TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-7dc8d805-b10c-4145-a28a-ee9dcdf7855fdefault-TEXT_VIEW-e1176865-6d51-42f6-9bd4-1e2d1ad73ef9default" + } + ], + "viewport": { + "x": 531.2578257632742, + "y": 458.93935293704044, + "zoom": 0.5 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/PROLOGIX_VER.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/PROLOGIX_VER.md new file mode 100644 index 0000000000..faa5ae01dd --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/PROLOGIX_VER.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..2c8697cf0e --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": "Inputs\n------\ndefault: DataContainer\n Any DataContainer - likely connected to the output of the OPEN_SERIAL node.", + "parameters": [ + { + "name": "connection", + "type": "Serial", + "description": "The open serial connection with the instrument." + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": "The Prologix controller available commands." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..b776214225 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.txt @@ -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. diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..77aa38df5b --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/python_code.txt @@ -0,0 +1,23 @@ +import serial, traceback +from flojoy import flojoy, SerialConnection, TextBlob, DataContainer +from typing import cast, Optional + + +@flojoy(deps={"pyserial": "3.5"}, inject_connection=True) +def PROLOGIX_VER( + connection: SerialConnection, + default: Optional[DataContainer] = None, +) -> TextBlob: + + + try: + # Start serial communication with the instrument + ser = cast(serial.Serial, connection.get_handle()) + if ser is None: + raise ValueError("Serial communication is not open") + ser.write(b"++ver\r\n") + s = ser.read(1000).decode() + except: + s = traceback.format_exc() + + return TextBlob(s) diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/hardware.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/media.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/notes.md b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/examples/EX1/app.json b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/examples/EX1/app.json new file mode 100644 index 0000000000..19669d125e --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/examples/EX1/app.json @@ -0,0 +1,324 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "type": "IO", + "data": { + "id": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "label": "OPEN SERIAL", + "func": "OPEN_SERIAL", + "type": "IO", + "ctrls": { + "device": { + "type": "SerialDevice", + "default": null, + "desc": "The connected serial device.", + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "device", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "baudrate": { + "type": "int", + "default": 9600, + "desc": null, + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "baudrate", + "value": 9600 + } + }, + "initCtrls": {}, + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": null + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL.py", + "selected": false + }, + "position": { + "x": -409.7072613691855, + "y": -119.46721173101321 + }, + "selected": false, + "positionAbsolute": { + "x": -409.7072613691855, + "y": -119.46721173101321 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "type": "IO", + "data": { + "id": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "label": "PROLOGIX HELP", + "func": "PROLOGIX_HELP", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_HELP", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "A list of available Prologix USB-to-GPIB firmware commands" + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/PROLOGIX_HELP.py", + "selected": false + }, + "position": { + "x": 43.7677951992148, + "y": -301.62936069100147 + }, + "selected": false, + "positionAbsolute": { + "x": 43.7677951992148, + "y": -301.62936069100147 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": true, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 423.4185766491661, + "y": -355.54847177565506 + }, + "selected": false, + "positionAbsolute": { + "x": 423.4185766491661, + "y": -355.54847177565506 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "type": "IO", + "data": { + "id": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "label": "PROLOGIX VER", + "func": "PROLOGIX_VER", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "PROLOGIX_VER", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The Prologix controller available commands." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/PROLOGIX_VER.py", + "selected": false + }, + "position": { + "x": 36.97386338103118, + "y": 100.85210674163193 + }, + "selected": false, + "positionAbsolute": { + "x": 36.97386338103118, + "y": 100.85210674163193 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37", + "label": "TEXT VIEW 1", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": { + "prettify": { + "type": "bool", + "default": false, + "desc": "Whether to prettify the displayed text (defaults to True)", + "overload": null, + "functionName": "TEXT_VIEW", + "param": "prettify", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "The DataContainer to be visualized in text format" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "The DataContainer containing text data" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 434.2592704786502, + "y": 53.58359116674569 + }, + "selected": false, + "positionAbsolute": { + "x": 434.2592704786502, + "y": 53.58359116674569 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "sourceHandle": "default", + "target": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231default-PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4default" + }, + { + "source": "PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4", + "sourceHandle": "default", + "target": "TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_HELP-73c23bcf-494c-4a68-9467-4da78bfb3fb4default-TEXT_VIEW-8260cd6b-0c5d-4e6a-b9f3-a5aca4c53567default" + }, + { + "source": "OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231", + "sourceHandle": "default", + "target": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-0379a423-93ea-47e9-83e4-13d5b7e33231default-PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98default" + }, + { + "source": "PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98", + "sourceHandle": "default", + "target": "TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37", + "targetHandle": "default", + "id": "reactflow__edge-PROLOGIX_VER-3ba9a232-95ac-4ff1-89fe-226ccd734e98default-TEXT_VIEW-e28cbcd7-ed1f-42bb-816a-e95fc6fc8c37default" + } + ], + "viewport": { + "x": 466.68096270497455, + "y": 429.1170430912722, + "zoom": 0.5180199090230052 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/SCPI_WRITE.md b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/SCPI_WRITE.md new file mode 100644 index 0000000000..169f494eb7 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/SCPI_WRITE.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..ee93d5cc31 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": "Inputs\n------\ndefault: DataContainer\n Any DataContainer - likely connected to the output of the OPEN_SERIAL node.", + "parameters": [ + { + "name": "connection", + "type": "Serial", + "description": "The open serial connection with the instrument." + } + ], + "returns": [ + { + "name": null, + "type": "Scalar|TextBlob", + "description": "The return value from the bench-top instrument as a Scalar or TextBlob." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..999209a695 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt @@ -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. diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..49b88b1615 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/python_code.txt @@ -0,0 +1,31 @@ +import serial +from flojoy import flojoy, SerialConnection, TextBlob, Scalar, DataContainer +from typing import cast, Optional + + +@flojoy(deps={"pyserial": "3.5"}, inject_connection=True) +def SCPI_WRITE( + connection: SerialConnection, + default: Optional[DataContainer] = None, + command: str = "*IDN?", +) -> Scalar | TextBlob: + + + # Start serial communication with the instrument + ser = cast(serial.Serial, connection.get_handle()) + + if ser is None: + raise ValueError("Serial communication is not open") + + CMD = command + "\n\r" + + ser.write(CMD.encode()) + + resp = ser.readline().decode() + + try: + resp = float(resp.rstrip("\n")) + except: + return TextBlob(resp) + + return Scalar(resp) diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/hardware.md b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/media.md b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/notes.md b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/examples/EX1/app.json b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/examples/EX1/app.json new file mode 100644 index 0000000000..8f3f163711 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/examples/EX1/app.json @@ -0,0 +1,240 @@ +{ + "name": "USB Camera", + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "SCPI_WRITE-52a454f8-4871-4856-b681-08d16ba3375b", + "type": "IO", + "data": { + "id": "SCPI_WRITE-52a454f8-4871-4856-b681-08d16ba3375b", + "label": "SCPI WRITE", + "func": "SCPI_WRITE", + "type": "IO", + "ctrls": { + "connection": { + "type": "SerialConnection", + "default": null, + "desc": "The open serial connection with the instrument.", + "overload": null, + "functionName": "SCPI_WRITE", + "param": "connection", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "command": { + "type": "str", + "default": "*IDN?", + "desc": null, + "overload": null, + "functionName": "SCPI_WRITE", + "param": "command", + "value": "MEASure:VOLTage?" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": "Any DataContainer - likely connected to the output of the OPEN_SERIAL node." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar|TextBlob", + "desc": "The return value from the bench-top instrument as a Scalar or TextBlob." + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/SCPI/SCPI_WRITE/SCPI_WRITE.py", + "selected": true + }, + "position": { + "x": 234.72013360308043, + "y": -167.20927235372574 + }, + "selected": true, + "positionAbsolute": { + "x": 234.72013360308043, + "y": -167.20927235372574 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "OPEN_SERIAL-d8d4820a-124d-486e-89ee-2bb873434dd4", + "type": "IO", + "data": { + "id": "OPEN_SERIAL-d8d4820a-124d-486e-89ee-2bb873434dd4", + "label": "OPEN SERIAL", + "func": "OPEN_SERIAL", + "type": "IO", + "ctrls": { + "device": { + "type": "SerialDevice", + "default": null, + "desc": "The connected serial device.", + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "device", + "value": "/dev/cu.usbserial-PX75GRVT" + }, + "baudrate": { + "type": "int", + "default": 9600, + "desc": null, + "overload": null, + "functionName": "OPEN_SERIAL", + "param": "baudrate", + "value": 9600 + } + }, + "initCtrls": {}, + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": null + } + ], + "pip_dependencies": [ + { + "name": "pyserial", + "v": "3.5" + } + ], + "path": "IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL.py", + "selected": false + }, + "position": { + "x": -119.78151756712703, + "y": -169.75657507433 + }, + "selected": false, + "positionAbsolute": { + "x": -119.78151756712703, + "y": -169.75657507433 + }, + "dragging": true + }, + { + "width": 273, + "height": 160, + "id": "PRINT_DATACONTAINER-84c3219c-85fd-4661-88c3-f8208d2113e1", + "type": "EXTRACTORS", + "data": { + "id": "PRINT_DATACONTAINER-84c3219c-85fd-4661-88c3-f8208d2113e1", + "label": "PRINT DATACONTAINER", + "func": "PRINT_DATACONTAINER", + "type": "EXTRACTORS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Input datacontainer information" + } + ], + "path": "EXTRACTORS/DEBUGGING/PRINT_DATACONTAINER/PRINT_DATACONTAINER.py", + "selected": false + }, + "position": { + "x": 557.3999599501618, + "y": -148.94821702035097 + }, + "selected": false, + "positionAbsolute": { + "x": 557.3999599501618, + "y": -148.94821702035097 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-784462fd-3284-40ac-bbd2-446e740f9edb", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-784462fd-3284-40ac-bbd2-446e740f9edb", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 947.7413591150134, + "y": -212.73757787208604 + }, + "selected": false, + "positionAbsolute": { + "x": 947.7413591150134, + "y": -212.73757787208604 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "OPEN_SERIAL-d8d4820a-124d-486e-89ee-2bb873434dd4", + "sourceHandle": "default", + "target": "SCPI_WRITE-52a454f8-4871-4856-b681-08d16ba3375b", + "targetHandle": "default", + "id": "reactflow__edge-OPEN_SERIAL-d8d4820a-124d-486e-89ee-2bb873434dd4default-SCPI_WRITE-52a454f8-4871-4856-b681-08d16ba3375bdefault" + }, + { + "source": "SCPI_WRITE-52a454f8-4871-4856-b681-08d16ba3375b", + "sourceHandle": "default", + "target": "PRINT_DATACONTAINER-84c3219c-85fd-4661-88c3-f8208d2113e1", + "targetHandle": "default", + "id": "reactflow__edge-SCPI_WRITE-52a454f8-4871-4856-b681-08d16ba3375bdefault-PRINT_DATACONTAINER-84c3219c-85fd-4661-88c3-f8208d2113e1default" + }, + { + "source": "PRINT_DATACONTAINER-84c3219c-85fd-4661-88c3-f8208d2113e1", + "sourceHandle": "default", + "target": "TEXT_VIEW-784462fd-3284-40ac-bbd2-446e740f9edb", + "targetHandle": "default", + "id": "reactflow__edge-PRINT_DATACONTAINER-84c3219c-85fd-4661-88c3-f8208d2113e1default-TEXT_VIEW-784462fd-3284-40ac-bbd2-446e740f9edbdefault" + } + ], + "viewport": { + "x": 461.8053939811623, + "y": 532.5623864271589, + "zoom": 1.4143748922070958 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/examples/EX1/example.md b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/examples/EX1/example.md new file mode 100644 index 0000000000..9ca0981355 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/examples/EX1/example.md @@ -0,0 +1 @@ +This app queries sends a SCPI string command to a connected benchtop instrument. Write the SCPI command in the parameter field of the SCPI_WRITE node. diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..cb4bff4fb7 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": null, + "parameters": [ + { + "name": "device", + "type": "Serial", + "description": "The connected serial device." + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": null + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt index 267175c76c..87b0c5ddb5 100644 --- a/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt @@ -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(), @@ -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())) \ No newline at end of file + return TextBlob(text_blob=json.dumps(ser.get_settings())) diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..b1d987e054 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.json @@ -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": [] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..bbf5c0d639 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.json @@ -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": [] +} \ No newline at end of file diff --git a/docs/nodes/LOGIC_GATES/LOOPS/APPEND/a1-[autogen]/python_code.txt b/docs/nodes/LOGIC_GATES/LOOPS/APPEND/a1-[autogen]/python_code.txt index 8ac3b9fe5a..871409e8f8 100644 --- a/docs/nodes/LOGIC_GATES/LOOPS/APPEND/a1-[autogen]/python_code.txt +++ b/docs/nodes/LOGIC_GATES/LOOPS/APPEND/a1-[autogen]/python_code.txt @@ -1,12 +1,12 @@ from numpy import append -from flojoy import flojoy, OrderedPair, Matrix, DataFrame, Vector, Scalar +from flojoy import flojoy, OrderedPair, OrderedTriple, Matrix, DataFrame, Vector, Scalar @flojoy def APPEND( - primary_dp: OrderedPair | Matrix | DataFrame | Scalar | Vector, + primary_dp: OrderedPair | OrderedTriple | Matrix | DataFrame | Scalar | Vector, secondary_dp: OrderedPair | Matrix | DataFrame | Scalar | Vector, -) -> OrderedPair | Matrix | DataFrame | Vector: +) -> OrderedPair | OrderedTriple | Matrix | DataFrame | Vector: if isinstance(primary_dp, OrderedPair) and isinstance(secondary_dp, OrderedPair): @@ -56,6 +56,20 @@ def APPEND( v = append([c0], [c1], axis=0) return Vector(v=v) + elif ( + isinstance(primary_dp, OrderedTriple) + and isinstance(secondary_dp, Vector) + and len(secondary_dp.v) == 3 + ): + x0 = primary_dp.x + y0 = primary_dp.y + z0 = primary_dp.z + + x = append(x0, secondary_dp.v[0]) + y = append(y0, secondary_dp.v[1]) + z = append(z0, secondary_dp.v[2]) + + return OrderedTriple(x=x, y=y, z=z) else: raise ValueError( diff --git a/docs/nodes/LOGIC_GATES/TIMERS/TIMER/a1-[autogen]/python_code.txt b/docs/nodes/LOGIC_GATES/TIMERS/TIMER/a1-[autogen]/python_code.txt index 354d6ba75b..02f3ce1542 100644 --- a/docs/nodes/LOGIC_GATES/TIMERS/TIMER/a1-[autogen]/python_code.txt +++ b/docs/nodes/LOGIC_GATES/TIMERS/TIMER/a1-[autogen]/python_code.txt @@ -1,9 +1,6 @@ -from flojoy import flojoy, DataContainer, DefaultParams -from flojoy.utils import PlotlyJSONEncoder +from flojoy import flojoy, DataContainer from flojoy.job_result_builder import JobResultBuilder -import plotly.graph_objects as go import time -import json from typing import Optional, cast @@ -19,5 +16,4 @@ def TIMER( DataContainer, JobResultBuilder().from_inputs([default] if default else []).build(), ) - return result diff --git a/docs/nodes/TRANSFORMERS/CALCULUS/FUNC_2_VAR/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/CALCULUS/FUNC_2_VAR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/TRANSFORMERS/MATRIX_MANIPULATION/TRANSPOSE_MATRIX/a1-[autogen]/docstring.json b/docs/nodes/TRANSFORMERS/MATRIX_MANIPULATION/TRANSPOSE_MATRIX/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..424a96e740 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/MATRIX_MANIPULATION/TRANSPOSE_MATRIX/a1-[autogen]/docstring.json @@ -0,0 +1,11 @@ +{ + "description": "Inputs\n------\na : Matrix\n The input matrix to be transposed", + "parameters": [], + "returns": [ + { + "name": null, + "type": "Matrix", + "description": "The transposed matrix" + } + ] +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/MATRIX_2_VECTOR/a1-[autogen]/docstring.json b/docs/nodes/TRANSFORMERS/TYPE_CASTING/MATRIX_2_VECTOR/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..e27ff65a9d --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/MATRIX_2_VECTOR/a1-[autogen]/docstring.json @@ -0,0 +1,11 @@ +{ + "description": "Inputs\n------\ndefault: Matrix\n The input matrix that will be transformed into vector data type.", + "parameters": [], + "returns": [ + { + "name": null, + "type": "Vector", + "description": "Vector that is flatten from input matrix." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/ORDERED_PAIR_2_VECTOR.md b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/ORDERED_PAIR_2_VECTOR.md new file mode 100644 index 0000000000..df1acfacc4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/ORDERED_PAIR_2_VECTOR.md @@ -0,0 +1,47 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.json b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..dd6382ab94 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.json @@ -0,0 +1,11 @@ +{ + "description": "Inputs\n------\ndefault : OrderedPair\n The input OrderedPair.", + "parameters": [], + "returns": [ + { + "name": null, + "type": "Vector", + "description": "The y component of the input OrderedPair." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e51e43393c --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.txt @@ -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. diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..19723dfab6 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/python_code.txt @@ -0,0 +1,8 @@ +from flojoy import flojoy, Vector, OrderedPair + + +@flojoy +def ORDERED_PAIR_2_VECTOR(default: OrderedPair) -> Vector: + + + return Vector(v=default.y) diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/hardware.md b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/media.md b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/notes.md b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/VECTOR_2_MATRIX/a1-[autogen]/docstring.json b/docs/nodes/TRANSFORMERS/TYPE_CASTING/VECTOR_2_MATRIX/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..d1a829b7f8 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/VECTOR_2_MATRIX/a1-[autogen]/docstring.json @@ -0,0 +1,22 @@ +{ + "description": "the shape is chosen by row and col parameters.\n\nInputs\n------\ndefault: Vector\n The input vector that will be transformed into matrix.", + "parameters": [ + { + "name": "row", + "type": "int", + "description": "number of rows for the new matrix" + }, + { + "name": "col", + "type": "int", + "description": "number of columns for the new matrix" + } + ], + "returns": [ + { + "name": null, + "type": "Matrix", + "description": "The matrix that is generated from the given vector and the parameters." + } + ] +} \ No newline at end of file diff --git a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.json b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.json index e15454d5df..44699f95fa 100644 --- a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.json +++ b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.json @@ -1,11 +1,17 @@ { - "description": "Inputs\n------\ndefault : TextBlob\n the DataContainer to be visualized in text format", - "parameters": [], + "description": "Inputs\n------\ndefault : TextBlob\n The DataContainer to be visualized in text format", + "parameters": [ + { + "name": "prettify", + "type": "Boolean", + "description": "Whether to prettify the displayed text (defaults to True)" + } + ], "returns": [ { "name": null, "type": "TextBlob", - "description": "the DataContainer containing text data" + "description": "The DataContainer containing text data" } ] } \ No newline at end of file diff --git a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt index 8db9cc3153..d091fba5f9 100644 --- a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt +++ b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt @@ -3,9 +3,14 @@ The TEXT_VIEW node creates a text visualization for a given TextBlob DataContain Inputs ------ default : TextBlob - the DataContainer to be visualized in text format + The DataContainer to be visualized in text format + + Parameters + ---------- + prettify : Boolean + Whether to prettify the displayed text (defaults to True) Returns ------- TextBlob - the DataContainer containing text data + The DataContainer containing text data diff --git a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt index 16cd9891c1..7b3dc82392 100644 --- a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt +++ b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt @@ -1,8 +1,14 @@ +import pprint from flojoy import flojoy, TextBlob @flojoy -def TEXT_VIEW(default: TextBlob): +def TEXT_VIEW(default: TextBlob, prettify: bool = False) -> TextBlob: - return default + s = default.text_blob + + if prettify: + s = pprint.pformat(default.text_blob) + + return TextBlob(s) diff --git a/docs/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt b/docs/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt index 563316f68c..57a4ab4df1 100644 --- a/docs/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt +++ b/docs/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt @@ -1,65 +1,23 @@ from flojoy import ( flojoy, - Plotly, OrderedPair, - DefaultParams, - SmallMemory, Scalar, Vector, ) -from typing import cast -import plotly.graph_objects as go -from nodes.VISUALIZERS.template import plot_layout -MEMORY_KEY = "BIG_NUMBER_MEMORY_KEY" - -@flojoy(inject_node_metadata=True) -def BIG_NUMBER( - default: OrderedPair | Scalar | Vector, - default_params: DefaultParams, - suffix: str, - prefix: str, - title: str, - relative_delta: bool = True, - scientific_notation: bool = False, -) -> Plotly: +@flojoy(node_type="BIG_NUMBER", forward_result=True) +def BIG_NUMBER(default: OrderedPair | Scalar | Vector, + scientific_notation: bool = False) -> Scalar: - job_id = default_params.job_id - node_name = __name__.split(".")[-1] - layout = plot_layout(title=title if title else node_name) - fig = go.Figure(layout=layout) - - prev_num = cast(str, SmallMemory().read_memory(job_id, MEMORY_KEY)) match default: case OrderedPair(): - big_num = default.y[-1] + return Scalar(default.y[-1]) case Scalar(): - big_num = default.c + return Scalar(default.c) case Vector(): - big_num = default.v[-1] + return Scalar(default.v[-1]) case _: - raise ValueError(f"Invalid input type {type(default)} for node {node_name}") - - delta_val_format = ".1%" if relative_delta is True else ".1f" - val_format = "%g" if scientific_notation is False else ".4e" - - fig.add_trace( - go.Indicator( - mode="number+delta", - value=big_num, - domain={"y": [0, 1], "x": [0, 1]}, - number={"prefix": prefix, "suffix": suffix, "valueformat": val_format}, - delta=None - if prev_num is None - else { - "reference": float(prev_num), - "relative": relative_delta, - "valueformat": delta_val_format, - }, - ) - ) - SmallMemory().write_to_memory(job_id, MEMORY_KEY, str(float(big_num))) - - return Plotly(fig=fig) + raise ValueError( + f"Invalid input type {type(default)} for node {node_name}") diff --git a/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_COMPONENTS/a1-[autogen]/python_code.txt b/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_COMPONENTS/a1-[autogen]/python_code.txt index fe06484623..b1292fcfdf 100644 --- a/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_COMPONENTS/a1-[autogen]/python_code.txt +++ b/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_COMPONENTS/a1-[autogen]/python_code.txt @@ -4,7 +4,7 @@ from flojoy import flojoy, run_in_venv, DataFrame, Plotly @flojoy @run_in_venv( pip_dependencies=[ - "prophet==1.1.4", + "prophet==1.1.5", ] ) def PROPHET_COMPONENTS(default: DataFrame, periods: int = 365) -> Plotly: diff --git a/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_PLOT/a1-[autogen]/python_code.txt b/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_PLOT/a1-[autogen]/python_code.txt index ac73a36a76..b232e3a237 100644 --- a/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_PLOT/a1-[autogen]/python_code.txt +++ b/docs/nodes/VISUALIZERS/PLOTLY/PROPHET_PLOT/a1-[autogen]/python_code.txt @@ -4,7 +4,7 @@ from flojoy import flojoy, run_in_venv, DataFrame, Plotly @flojoy @run_in_venv( pip_dependencies=[ - "prophet==1.1.4", + "prophet==1.1.5", ] ) def PROPHET_PLOT(default: DataFrame, periods: int = 365) -> Plotly: diff --git a/docs/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt b/docs/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt index 842bf687fd..3a26c7e3dd 100644 --- a/docs/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt +++ b/docs/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt @@ -5,9 +5,19 @@ from flojoy import DataFrame, Matrix, OrderedPair, Plotly, flojoy, Vector from nodes.VISUALIZERS.template import plot_layout -@flojoy -def SCATTER(default: OrderedPair | DataFrame | Matrix | Vector) -> Plotly: +@flojoy(node_type="SCATTER", forward_result=True) +def SCATTER(default: OrderedPair | DataFrame | Matrix | Vector) -> OrderedPair: + + match default: + case OrderedPair(): + return default + case Vector(): + return OrderedPair(x=np.arange(len(default.v)), y=default.v) + case _: + raise TypeError( + f"SCATTER node does not support input of type {type(default)}") + layout = plot_layout(title="SCATTER") fig = go.Figure(layout=layout) match default: @@ -17,7 +27,8 @@ def SCATTER(default: OrderedPair | DataFrame | Matrix | Vector) -> Plotly: dict_keys = list(default.x.keys()) x = default.x[dict_keys[0]] y = default.y - fig.add_trace(go.Scatter(x=x, y=y, mode="markers", marker=dict(size=4))) + fig.add_trace( + go.Scatter(x=x, y=y, mode="markers", marker=dict(size=4))) case DataFrame(): df = pd.DataFrame(default.m) first_col = df.iloc[:, 0] @@ -28,13 +39,17 @@ def SCATTER(default: OrderedPair | DataFrame | Matrix | Vector) -> Plotly: for col in df.columns: if col != df.columns[0]: fig.add_trace( - go.Scatter(x=first_col, y=df[col], mode="markers", name=col) - ) + go.Scatter(x=first_col, + y=df[col], + mode="markers", + name=col)) else: for col in df.columns: fig.add_trace( - go.Scatter(x=df.index, y=df[col], mode="markers", name=col) - ) + go.Scatter(x=df.index, + y=df[col], + mode="markers", + name=col)) case Matrix(): m: np.ndarray = default.m @@ -44,13 +59,16 @@ def SCATTER(default: OrderedPair | DataFrame | Matrix | Vector) -> Plotly: for i in range(num_rows): fig.add_trace( - go.Scatter(x=x_ticks, y=m[i, :], name=f"Row {i+1}", mode="markers") - ) + go.Scatter(x=x_ticks, + y=m[i, :], + name=f"Row {i+1}", + mode="markers")) fig.update_layout(xaxis_title="Column", yaxis_title="Value") case Vector(): y = default.v x = np.arange(len(y)) - fig.add_trace(go.Scatter(x=x, y=y, mode="markers", marker=dict(size=4))) + fig.add_trace( + go.Scatter(x=x, y=y, mode="markers", marker=dict(size=4))) return Plotly(fig=fig) diff --git a/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/docstring.txt b/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/docstring.txt index 124eb35e6d..943d1ca199 100644 --- a/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/docstring.txt +++ b/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/docstring.txt @@ -2,7 +2,7 @@ The SCATTER3D node creates a Plotly 3D Scatter visualization for a given input D Inputs ------ - default : OrderedTriple|DataFrame + default : OrderedTriple|DataFrame|Vector the DataContainer to be visualized Returns diff --git a/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt b/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt index ed5786af06..e6d78933f6 100644 --- a/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt +++ b/docs/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt @@ -1,24 +1,33 @@ -import plotly.graph_objects as go -import plotly.express as px -from flojoy import OrderedTriple, DataFrame, Plotly, flojoy -from nodes.VISUALIZERS.template import plot_layout +from flojoy import DataContainer, Vector, OrderedTriple, DataFrame, flojoy +import numpy as np -@flojoy -def SCATTER3D(default: OrderedTriple | DataFrame) -> Plotly: +@flojoy(node_type="SCATTER3D", forward_result=True) +def SCATTER3D( + default: OrderedTriple | DataFrame | Vector, + point_size: int = 4, + show_xy_plane: bool = False, + show_xz_plane: bool = True, + show_yz_plane: bool = False, + x_min: float = -10, + x_max: float = 10, + x_step: float = 1, + y_min: float = 0, + y_max: float = 10, + y_step: float = 1, + z_min: float = -10, + z_max: float = 10, + z_step: float = 1, +) -> DataContainer: - layout = plot_layout(title="SCATTER3D") - fig = go.Figure(layout=layout) match default: + case Vector(): + return default case OrderedTriple(): x = default.x - if isinstance(default.x, dict): - dict_keys = list(default.x.keys()) - x = default.x[dict_keys[0]] y = default.y z = default.z - fig.add_trace(go.Scatter3d(x=x, y=y, z=z, mode="markers")) case DataFrame(): df = default.m if len(df.columns) < 3: @@ -26,10 +35,8 @@ def SCATTER3D(default: OrderedTriple | DataFrame) -> Plotly: "DataFrame must have at least 3 columns for x, y, and z coordinates." ) - x_column = df.columns[0] - y_column = df.columns[1] - z_column = df.columns[2] + x = df.columns[0].to_numpy() + y = df.columns[1].to_numpy() + z = df.columns[2].to_numpy() - fig = px.scatter_3d(df, x=x_column, y=y_column, z=z_column, color=z_column) - - return Plotly(fig=fig) + return Vector(v=np.column_stack((x, y, z)), extra=default.extra) diff --git a/nodeSidebar.json b/nodeSidebar.json index 1329656f26..d32841349a 100644 --- a/nodeSidebar.json +++ b/nodeSidebar.json @@ -133,6 +133,7 @@ "nodes/TRANSFORMERS/TYPE_CASTING/MATRIX_2_VECTOR/MATRIX_2_VECTOR", "nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/MAT_2_DF", "nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/NP_2_DF", + "nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/ORDERED_PAIR_2_VECTOR", "nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_TRIPLE_2_SURFACE/ORDERED_TRIPLE_2_SURFACE", "nodes/TRANSFORMERS/TYPE_CASTING/VECTOR_2_MATRIX/VECTOR_2_MATRIX", "nodes/TRANSFORMERS/TYPE_CASTING/VECTOR_2_ORDERED_PAIR/VECTOR_2_ORDERED_PAIR" @@ -162,18 +163,24 @@ "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/OUTPUT_SYNC_33510B", "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/SET_WAVEFORM_33510B" ], - "I/O > Microcontrollers": [ + "I/O > MOCK": [ + "nodes/IO/INSTRUMENTS/MOCK/WEINSCHEL8320/WEINSCHEL8320" + ], + "I/O > MicroControllers": [ "nodes/IO/MICROCONTROLLERS/ESP32/ESP32", "nodes/IO/MICROCONTROLLERS/RPI2040/RPI2040", "nodes/IO/MICROCONTROLLERS/STM32/STM32" ], "I/O > Motion > Motor Driver": [ - "nodes/IO/MOTION/MOTOR_DRIVER/BLDC/TINYMOVR/TINYMOVR_CALIBRATE", - "nodes/IO/MOTION/MOTOR_DRIVER/BLDC/TINYMOVR/TINYMOVR_SET_VOLTAGES", + "nodes/IO/MOTION/MOTOR_DRIVER/BLDC/LINENGINEERING/LINENGINEERING", + "nodes/IO/MOTION/MOTOR_DRIVER/BLDC/TINYMOVR/TINYMOVR", + "nodes/IO/MOTION/MOTOR_DRIVER/SERVO/TINYMOVR2/TINYMOVR2", + "nodes/IO/MOTION/MOTOR_DRIVER/STEPPER/ADAFRUIT/ADAFRUIT", "nodes/IO/MOTION/MOTOR_DRIVER/STEPPER/POLULU/TIC/TIC", - "nodes/IO/MOTION/MOTOR_DRIVER/STEPPER/POLULU/TIC_KNOB/TIC_KNOB" + "nodes/IO/MOTION/MOTOR_DRIVER/STEPPER/POLULU/TIC_KNOB/TIC_KNOB", + "nodes/IO/MOTION/MOTOR_DRIVER/STEPPER/ZABER/ZABER" ], - "I/O > Oscilloscopes > Tektronix": [ + "I/O > Oscilloscopes": [ "nodes/IO/INSTRUMENTS/OSCILLOSCOPES/TEKTRONIX/MDO3XXX/ADVANCED/ADVANCED_MEASUREMENTS_MDO3XXX/ADVANCED_MEASUREMENTS_MDO3XXX", "nodes/IO/INSTRUMENTS/OSCILLOSCOPES/TEKTRONIX/MDO3XXX/ADVANCED/TRIGGER_SETTINGS_MDO3XXX/TRIGGER_SETTINGS_MDO3XXX", "nodes/IO/INSTRUMENTS/OSCILLOSCOPES/TEKTRONIX/MDO3XXX/BASIC/CONNECTION_MDO3XXX/CONNECTION_MDO3XXX", @@ -184,16 +191,31 @@ "nodes/IO/INSTRUMENTS/OSCILLOSCOPES/TEKTRONIX/MDO3XXX/BASIC/TRIGGER_CHANNEL_MDO3XXX/TRIGGER_CHANNEL_MDO3XXX", "nodes/IO/INSTRUMENTS/OSCILLOSCOPES/TEKTRONIX/MDO3XXX/BASIC/TRIGGER_LEVEL_MDO3XXX/TRIGGER_LEVEL_MDO3XXX" ], - "I/O > Protocols > SCPI": [ + "I/O > Protocols": [ + "nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/CAN_MESSAGE", + "nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/PROLOGIX_ADDR", + "nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/PROLOGIX_AUTO", + "nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/PROLOGIX_HELP", + "nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/PROLOGIX_MODE", + "nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/PROLOGIX_VER", "nodes/IO/PROTOCOLS/SCPI/IDN/IDN", - "nodes/IO/PROTOCOLS/SCPI/MEASURE_VOLTAGE/MEASURE_VOLTAGE" - ], - "I/O > Protocols > Serial": [ + "nodes/IO/PROTOCOLS/SCPI/MEASURE_VOLTAGE/MEASURE_VOLTAGE", + "nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/SCPI_WRITE", "nodes/IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL", "nodes/IO/PROTOCOLS/SERIAL/BASIC/SERIAL_SINGLE_MEASUREMENT/SERIAL_SINGLE_MEASUREMENT", - "nodes/IO/PROTOCOLS/SERIAL/BASIC/SERIAL_TIMESERIES/SERIAL_TIMESERIES" - ], - "I/O > Sourcemeters": [ + "nodes/IO/PROTOCOLS/SERIAL/BASIC/SERIAL_TIMESERIES/SERIAL_TIMESERIES", + "nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/OPEN_SERIAL", + "nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/SERIAL_SINGLE_MEASUREMENT", + "nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/SERIAL_TIMESERIES", + "nodes/IO/PROTOCOLS/SERIAL/SINGLE_MEASUREMENT/SINGLE_MEASUREMENT", + "nodes/IO/PROTOCOLS/VISA/VISA" + ], + "I/O > QCODES": [ + "nodes/IO/INSTRUMENTS/QCODES/CLOSE_ALL/CLOSE_ALL", + "nodes/IO/INSTRUMENTS/QCODES/LIST_VISA/LIST_VISA", + "nodes/IO/INSTRUMENTS/QCODES/VISA_IDENTITY/VISA_IDENTITY" + ], + "I/O > SourceMeters": [ "nodes/IO/INSTRUMENTS/SOURCEMETERS/KEITHLEY/24XX/BASIC/IV_SWEEP/IV_SWEEP", "nodes/IO/INSTRUMENTS/SOURCEMETERS/KEITHLEY/24XX/BASIC/OPEN_KEITHLEY_24XX/OPEN_KEITHLEY_24XX", "nodes/IO/INSTRUMENTS/SOURCEMETERS/KEITHLEY/24XX/BASIC/SET_VOLTAGE/SET_VOLTAGE"