Labview程序框图如下:

Python脚本如下:

#!/usr/bin/env python
import sys

#Command Line Arguements are stored in list argv
numArgs = len(sys.argv) - 1
sum = 0

#Iterate through each element and add to the sum
for n in range (1, len(sys.argv)):
  sum = sum + int(sys.argv[n])

sum = int(sys.argv[1]) - int(sys.argv[2])

#use the print function to output the sum
print sum

脚本.py文件在这种情况下需要放在当前VI的文件目录下。

posted on 2016-08-27 22:19  浪迹枫叶  阅读(7254)  评论(1编辑  收藏  举报