Running external python scripts error

I wrote a scripts to read a sensor value from NIDAQ , in pycharm it works.
But in Script Console , there is an error.
message = f'{message}\n\nTask Name: {task_name}'
SyntaxError: no viable alternative at input ''{message}\n\nTask Name: {task_name}''

The code is here: import nidaqmx
import time

Initialize DAQ Device

task = nidaqmx.Task()

Ts = 1 # Sampling Time
N = 5
for k in range(N):
value =
air = (value-0.004)/0.016*147
print("Air Flow =", round(value,3), "CFM")

Terminate DAQ Device


Thank you.

At the very least, you need to import this 3rd party library so that Ignition can use it: Libraries | Ignition User Manual

This library will need to be compatible with Python 2.7 and not use any CPython/native code.


The file "" is in the "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib ".

The following is from NI website:

The nidaqmx package contains the Application Programming Interface (API) for interacting with the NI-DAQmx driver and it is supported on Windows using CPython 2.7, 3.4+, PyPy2, and PyPy3.

Jython (and Python) 2.7 do not have "f" strings.

1 Like

I don't see Jython in that list.

1 Like

Thank you everyone!

That means I cannot use that library in ignition.

Not directly no. You can always shell out to it if you have CPython on the computer in general and using system.util.execute or ProcessBuilder. You can find examples throughout the forum like here Subprocess & system.util.execute

Thank you.