Discussion:
microcontroller synchronize
(too old to reply)
siva0182
2008-08-15 06:10:06 UTC
Permalink
I have mangead to acquire data from a yokogawa source meter thro labview using the drivers.
.I have an external microcontroller doing multiplexing /switching..and a separate sourcemeter to source and measure.
The aim is to synchronise every "measure" action by the source meter with every swithcing done by the microcontroller.
Thoudh the delay timings are roughly the same..the electrical starting transient times are different for both the circuits so any suggestions to synchronize these two circuits are welcome?
LuI
2008-08-15 06:40:28 UTC
Permalink
Your µC must have a controlling interface, usually via RS-232 or USB. Use a sequence of {switch | measure}, probably inside a loop to synchronice your tasks. Depending on the expected settling time you may want to add some wait nodes inbetween switch and measure.If this SW-based sync is'nt quick enough your µC must poll a digital signal you send from LV or even better your meter may provide as a 'data ready' signal.Can't be more specific without more details.  Greetings from Germany!
--
Uwe
siva0182
2008-08-15 06:40:28 UTC
Permalink
yes I have a Rs232 interface for the micro controller..I will try to switch from matlab as you say..
But Will using 2 COM ports simultaneously create any problem?
any precautions to take while handling two ports simultaneously?
siva0182
2008-08-15 06:40:29 UTC
Permalink
sorry i meant to say that i would try from labview (not matlab..)
LuI
2008-08-15 07:10:06 UTC
Permalink
As always - it depends...AFAIK the standard operation mode for RS-232 using VISA is asynchron, so you can operate as much serial ports in parallel a you want and your system can handle. This can, however be changed which than could lead to problems.But in your case you need to operate both ports alternating in order to get the desired sync. Pseudocode could beOpen & configure Port 1Open & configure Port 2 While not done  set your switch   wait for settling  get your data  store data in a chart or in a shift register  while_end Close portssave your data If your data size can not be stored in RAM (more than, say, several 100 MB) you need to use a producer-consumer architecture that can save data in a file while other (newer) data is acquired. But this is overshoot in case of your data size is (much) less than the above mentioned number.Greetings from Germany!
--
Uwe
siva0182
2008-08-15 11:40:09 UTC
Permalink
Thanks a lot .I will try it next week and come back with results I get. regardsSiva 
Loading...