Sign In
Cart
Test Solutions
Aircraft
F-15
F-16
F/A-18
F-35
AH-64
Remotely Piloted Aircraft (RPA)
Weapons Systems
AGM-65 Maverick
AGM-114 Hellfire
GBU-xx Paveway
AIM-9 Sidewinder
Maintenance Levels
O-Level
I-Level
Depot-Level
Aerospace Test System
TS-321 Series
Automotive Test System
TS-322 Series
Satellite Test System
TS-323 Series
Core Test System
TS-705
Base Analog/Digital Core Test System
TS-710
Core Test System with Boundary Scan
TS-720
Mixed Signal Test System
TS-730
Digital Test System
TS-750
Commercial Avionics Test System
TS-770
Military Avionics Test System
TS-775
GENASYS
High Performance Mixed Signal Test Platform
GENASYS Benchtop
Compact / Portable Test Platform
5G mmWave
Production Test Platform
TS-900e-5G Series
RF, Analog, and Digital Upgrade/Expansion
MTEK Series
Integrated Semiconductor Test Platform
TS-900 Series
Integrated Semiconductor Test Platform with Timing per Pin
TS-960 Series
Integrated Semiconductor Test Platform with Timing per Pin
TS-960e Series
GENASYS Semi
Semiconductor Test Platform
Aerospace Test System
TS-321 Series
Automotive Test System
TS-322 Series
Satellite Test System
TS-323 Series
Core Test System
TS-705
Base Analog/Digital Core Test System
TS-710
Core Test System with Boundary Scan
TS-720
Mixed Signal Test System
TS-730
Digital Test System
TS-750
Commercial Avionics Test System
TS-770
Military Avionics Test System
TS-775
GENASYS
High Performance Mixed Signal Test Platform
GENASYS Benchtop
Compact / Portable Test Platform
Rugged Field Test Set
MTS-207
SmartCan Universal Hand-held Test Set
MTS-3060C SmartCan
Portable PXI Chassis
GX7600
SmartCan Universal
Armament Test Set
3060A SmartCan
Maverick Field Test Set
MTS-206A
SmartCan -
Maverick AGM-65
MTS-3060A AGM-65
Hellfire / Longbow Test Set
AN-TSM-205
SmartCan -
AMRAAM AIM-120
MTS-3060A AIM-120
Modular Target Simulator
MTS-916
F-35 Armament Test Set
MTS-235A
Laser Source Simulator
MTS-1888
Common Armament Test Set
MTS-209
Hellfire Missile Simulator
MT3045
Rugged Field Test Set
MTS-207
Hellfire / Longbow Test Set
AN-TSM-205
Maverick Field Test Set
MTS-206A
Common Armament Test Set
MTS-209
F-35 Armament Test Set
MTS-235A
Commercial
Military
GENASYS Rugged
Adverse Environment Test Platform
Test Executive and IDE
ATEasy
Digital I/O Vector Suite
DIOEasy
Semiconductor Test Suite
ICEasy
Waveform Analysis Suite
WaveEasy
LASAR Development Suite
DtifEasy
Calibration & Verification
CalEasy
Products
Software
ATEasy
DIOEasy
DtifEasy
WaveEasy
CalEasy
ICEasy
All Software Products
Chassis & Controllers
Chassis
Chassis Controllers and Bus Expanders
All Chassis and Controllers Products
Digital I/O
Dynamic Digital I/O Instrumentation
Static Digital I/O Instrumentation
Digital I/O Software and Training
ROM Emulator Instrumentation
JTAG / BDM Instrumentation
All Digital I/O Products
Measurement
Digital Multimeter Instrumentation
Counter Timer Instrumentation
Digitizer Instrumentation
A/D Converters, Multi-function Instrumentation
All Measurement Products
Stimuli
Arbitrary Function Generators
Standards Source Instrumentation
Multi-function Instrumentation
D/A Converters and Precision DC Source Instrumentation
All Stimulus Products
FPGA
Digital I/O
Multi-Function
All FPGA Products
Switching
3U PXI
6U PXI
GENASYS
Matrix
Multiplexer
RF
High Current
High Density
General Purpose
All Switching Products
SMUs & Power Supplies
Power Supply Mainframe and Modules Instrumentation
Precision DC Source Instrumentation
All SMUs & Power Supplies Products
Bus Interfaces
Bus Expanders
GPIB
MIL-STD-1553
ARINC 429
Comm
All Bus Interfaces Products
GPIB Instrumentation Replacements
Wavetek Replacements
HP Replacements
All GPIB Instrumentation Replacements Products
PXI Instruments
Chassis and Controllers
Digital I/O
Measurement
Stimuli
FPGA Cards
Switching
Power Supplies
Bus Interfaces
All PXI Instruments Products
Legacy
GTXI Chassis, Controllers and Instrumentation
Digital I/O
Stimuli
Switching
Power Supplies
All Legacy Products
Military
Missile Launchers
All Military Products
Support
M@GIC Online Support
User Forums
Knowledge Base
White Papers
Downloads
Recent Downloads
News & Events
Blogs
Newsletters
External Articles
RSS Feeds
Press Releases
Tradeshows & Events
Workshops & Seminars
Recent Downloads
Company
Company Profile
Links & Affiliates
Privacy Policy & Terms of Use
Quality & Regulatory
Contact Us
Find a Representative
Maps & Directions
Careers
Menu
Sign In
Test Solutions
Military
Areospace
Semiconductor
Manufacturing & Production
Portable & Handheld
Software
Products
Software
ATEasy
DIOEasy
ICEasy
WaveEasy
DtifEasy
CalEasy
All Software Products
Chassis & Controllers
Chassis
Chassis Controllers and Bus Expanders
All Chassis and Controllers Products
Digital I/O
Dynamic Digital I/O Instrumentation
Static Digital I/O Instrumentation
Digital I/O Software and Training
ROM Emulator Instrumentation
JTAG / BDM Instrumentation
All Digital I/O Products
Measurement
Digital Multimeter Instrumentation
Counter Timer Instrumentation
Digitizer Instrumentation
A/D Converters, Multi-function Instrumentation
All Measurement Products
Stimuli
Arbitrary Function Generators
Standards Source Instrumentation
Multi-function Instrumentation
D/A Converters and Precision DC Source Instrumentation
All Stimulus Products
FPGA
Digital I/O
Multi-Function
All FPGA Products
Switching
3U PXI
6U PXI
GENASYS
Matrix
Multiplexer
RF
High Current
High Density
General Purpose
All Switching Products
SMUs & Power Supplies
Power Supply Mainframe and Modules Instrumentation
Precision DC Source Instrumentation
All SMUs & Power Supplies Products
Bus Interfaces
Bus Expanders
GPIB
MIL-STD-1553
ARINC 429
Comm
All Bus Interfaces Products
GPIB Instrumentation Replacements
Wavetek Replacements
HP Replacements
All GPIB Instrumentation Replacements Products
PXI Instruments
Chassis and Controllers
Digital I/O
Measurement
Stimuli
FPGA Cards
Switching
Power Supplies
Bus Interfaces
All PXI Instruments Products
Legacy
GTXI Chassis, Controllers and Instrumentation
Digital I/O
Stimuli
Switching
Power Supplies
All Legacy Products
Military
Missile Launchers
All Military Products
Support
M@GIC Online Support
Users Forums
Knowledge Base
White Papers
Downloads
Recent Downloads
News & Event
Blogs
Newsletters
ExternalArticles
RSS Feeds
Press Releases
Tradeshows & Events
Workshops & Seminars
Recent Downloads
Company
Company Profiles
Links & Affiliates
Privacy Policy & Terms of Use
Quality & Regulatory
Contact Us
Find A Representive
Maps & Directions
Careers
USA
Communicating with controls in form from another thread
Home
»
Support
»
User Forums
»
ATEasy - General
Louis S.
White Plains, NY
Aug 29, 2011
13
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
Is there a recommended way to update controls in the UI thread from another thread?
Edit your Message
DrATEasy (Ron Y.)
Mission Viejo, CA
Aug 29, 2011
368
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
ATEasy built-in controls are thread safe and can be called from any thread including the threads that did not create the form or control.
Calling a control method or property from another thread will be slower than calling it from the thread that the control was create with and will result in a thread switch.
Edit your Message
Louis S.
White Plains, NY
Aug 29, 2011
13
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
Is it preferred to use a global value with a mutex or some form of signaling than?
What would be the syntax for addressing the control in a form from the process function?
Thanks,
Louis
Edit your Message
DrATEasy (Ron Y.)
Mission Viejo, CA
Aug 29, 2011
368
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
1. No. Since the call to another thread control is a blocking call (will not return until the method or property are done). If the UI thread is just used to display a form that the delay should very small. If the main thread is running a test program than you should consider moving the form to the worker thread or use another thread for the form. In any case, make sure the UI thread uses WaitForEvent to handle the form events and minimize CPU usage.
2. If you have a global variable m_frm A: FormA and a control chkB. you need to make sure that the control and the from are defined as public and than call it from anywhere using m_frmA.chkB.
Edit your Message
Louis S.
White Plains, NY
Aug 29, 2011
13
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
I had forgotten to check the public box, thanks!
It does seem to run significantly slower doing the cross thread updates (43 Hz vs 10KHz), so I'm going to leave them out for now. It's a standard form so it should be spending it's time waiting for events already. I don't get much benefit from being above 1 KHz anyway since I'm generating my test waveform using tick().
Edit your Message
DrATEasy (Ron Y.)
Mission Viejo, CA
Aug 29, 2011
368
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
You don't really need to update the control that much since you can't see it anyways. Did you try a timer control (10 updates per second 100 msec or 5 every 200msec)?
Edit your Message
Louis S.
White Plains, NY
Aug 30, 2011
13
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
I think I may have misunderstood how to set this up.
I created a thread that writes to an I/O card as often as possible. 1 kHz would be the ideal rate since the function being generated is dependent on tick which updates every 1 msec. By putting this code in a timing-critical thread, I can run the output update at approximately 10 kHz.
This output is also controlled by a manual slider control which is disabled during this automated output. It would be nice for the disabled control to show what the current output is so the user has a better indication of what the automated output is doing. This doesn't have to be anywhere near as often as the updates, but can't get in their way. If I had a separate timer updating the slider control, wouldn't that have to temporarily stop the update thread while it is getting the current value (either by reading from the I/O card or by accessing a global variable)?
Edit your Message
DrATEasy (Ron Y.)
Mission Viejo, CA
Aug 30, 2011
368
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
If the shared data is a numeric value you can access at the same time from the timer and the thread, I don't think you will have a lot of misses since the integer is pretty atomic. You can use a ACriticalSection object to lock and protect the global value from being access at the same time but this will slow things a bit. See example for how to use that in Language.prg example (Multithreading task).
Edit your Message
Louis S.
White Plains, NY
Aug 30, 2011
13
Posts
0
✔
|
✗
0
Re:
Communicating with controls in form from another thread
That worked. It still can cause slowdowns if I move the form object around, but it seems impervious to other outside events.
Edit your Message
Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click
here
to register today!
All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk.
[Read More]
Select Your Country
Email this Page
Your Name
Required
Your Email
Required
(use commas to separate multiple email addresses)
To Email
Required
Subject
Required
Link
Enter message in space below