NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

using teststand semaphore

Why the first time create semaphore, the semaphore exist boolean is still false, but become true after Acquire semaphore. Second my AI SINGLE Scan took 0.4 second to scan two channels of scxi input. How can I improve(shorten) the time.
0 Kudos
Message 1 of 6
(4,095 Views)
Hi trout00,

From the TestStand perspective, the AlreadyExists output should return True once the semaphore has been created. Note that the first time you call create, the output will be False, until you call the create again and try to create a semaphore with the same name. I have attached a small sequence that you can use to verify this. Simply run it, and watch the value of Locals.AlreadyExists. You can run it with the SequentialModel.seq. You also need to provide more information on where you are seeing that the output is incorrect (i.e. what step). Also where do you do the create? Keep in mind that the semaphore reference is local to a process and will not work across processes in your case.

Bob
0 Kudos
Message 2 of 6
(4,095 Views)
Bob,
What do I need to use to protect call NIDAQ.dll by different processes.

Regards
Tom
0 Kudos
Message 3 of 6
(4,095 Views)
Hi,

If you want to use the synchronization across processes then you need to preceed their name by an asteriks. See page 11-3 of the TestStand 2.0.1f1 User Manual. Are you sure this is what you need? Maybe if you let me know what your application is doing, I can give you a more detailed solution.

Bob
0 Kudos
Message 4 of 6
(4,095 Views)
Bob,
Thank you for the answer. Yes, I use the asterisk.
My project is to control, monitor and test two different types of motors. (not two motors). All motors have encoder feedback.
Group 1:
1. Five Small stepper motors, they don't move fast about 1 inch/3 seconds.
2. TWo medium stepper motors,
3. One large stepper motor.
Group 2:
4. Two stepper motors (rotational axis and linear axis)
5. One stepper motor, rocking up/down
6. One brushless motor
The motors are assigned to four different engineers.
National instruments hardware does not control the motor directly, more like monitoring.
There are five different pc board controlling the motors.
The computer sends a serial command (motorNum, velocity,position, current drive...) to
the pc boards, and the pc boards controls the motors.
National Instruments Hardware:
PCI-6036E -> SCXI 1000 ->MOD3:SCXI1520-1314-StrainGauge
MOD4:SCXI1520-1314-StrainGaug
MOD2:SCXI1102-1303-ThermoJ
Using TestStand 2.01 and LabView 6.1 I send serial command to one single motor(module+motornum). When the motor move to its position, it will apply a force on the strain gauge, and I acquire the applied force and temperature for one motor.
It takes about 5-7 seconds for one cycle per motor.
Number of cycles ~ 10000( running all day).
I plan to have a single sequence for each motor.(running different processes/different engineers).
I need to protect the serial port and the NI hardware for sharing data. Only one serial port is using because all pc boards are on the same RS485 bus.
System is Win2000
0 Kudos
Message 5 of 6
(4,095 Views)
Hi trout00,

This question would probably be best answered by a call to the Application Engineers at NI since the details are bit involved to write down here. But on high level, you should probably use a lock since only thread can be accessing the serial port at any given time. You do not necessarily need the asteriks unless you are running each sequence in a different operator interface/sequence editor or over the network. If all sequences are run on the same machine by the same OI, then you need not use the asteriks. Either way it should work. Nevertheless, you simply would create the lock in one sequence, perhaps the a process model if you are using one, or the sequence that runs at the highest level of your call chain.
All the other engineers have to do when they are creating their sequence, is use a lock and unlock step around the steps that they want exclusive rights to the hardware. Since there will be only one serial port, everyone should use the same lock. If each step in the sequence requires access to a resource then you may want to implement the locking/unlocking in a post/prestep callback. It seems to me that having only one serial port is a real bottleneck in the system, but a call to NI support would allow you to answer their questions much more easily over the phone.

Bob
0 Kudos
Message 6 of 6
(4,095 Views)