Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Transfer instrument PRs from nodes repo #5

Merged
merged 8 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from flojoy import flojoy, DataContainer, TextBlob
from typing import Optional
import ctypes
from picosdk.ps2000 import ps2000 as ps
from picosdk.functions import assert_pico2000_ok


@flojoy(deps={"picosdk": "1.1"})
def CONNECTION_2000(
default: Optional[DataContainer] = None,
) -> TextBlob:
"""The CONNECTION_2000 node connects Flojoy to an available Picoscope.

If more than one P2000 oscilloscope is available, the first one connected
to the PC will likely be chosen. If you need specific device selection,
please contact us at: https://www.flojoy.ai/contact-sales.

Note the P2000 nodes require a device specific driver/SDK downloaded from:
https://www.picotech.com/downloads.

Parameters
----------
None

Returns
-------
TextBlob
Placeholder return currently
"""

ps.ps2000_close_unit(ctypes.c_int16(1))

status = {}
status["openUnit"] = ps.ps2000_open_unit()
assert_pico2000_ok(status["openUnit"])

return TextBlob(text_blob=str(status["openUnit"]))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading