Connecting to Newmark-NSC-A1 by Newmark in Python
Instrument Card
The NSC-A1 Series motion controller is a powerful single axis stepper motor control system which combines a microstepping driver with a programmable controller into a compact envelope
Device Specification: here
Manufacturer card: NEWMARK
Newmark Systemsย is a world leader in precision rotary table technology designed for critical positioning applications
- Headquarters: USA
- Yearly Revenue (millions, USD): 12
- Vendor Website: here
Demo: Send commands to a Polulu stepper motor driver
Connect to the Newmark-NSC-A1 in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
To connect to a Newmark-NSC-A1 Motion using Instrumental, you can use the following Python script:
from instrumental import instrument, list_instruments
# Find the Newmark-NSC-A1 Motion instrumentinstruments = list_instruments()newmark_instrument = Nonefor instrument in instruments: if 'Newmark-NSC-A1' in instrument: newmark_instrument = instrument break
# Connect to the Newmark-NSC-A1 Motion instrumentif newmark_instrument: motion = instrument(newmark_instrument) print("Connected to Newmark-NSC-A1 Motion")
# Get the current angle of the stage angle = motion.angle print(f"Current angle: {angle}")
# Rotate the stage clockwise by 90 degrees motion.cw(90)
# Set the velocity of the stage to 10 degrees per second motion.velocity = 10
# Disconnect from the motion controller motion.close()else: print("Newmark-NSC-A1 Motion not found")
This script first imports the necessary functions from the instrumental
module. It then uses the list_instruments()
function to get a list of available instruments. It searches for an instrument with the name containing โNewmark-NSC-A1โ and assigns it to the newmark_instrument
variable.
If a Newmark-NSC-A1 Motion instrument is found, it uses the instrument()
function to connect to the instrument and assigns it to the motion
variable. Finally, it prints a message indicating whether the connection was successful or not.
Note: The script assumes that you have already installed the instrumental
package.