From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

read an analogical signal and a signal from the serial port

I have to read an analogical signal from the card 6034E and a signal from the serial port, to intervals of time of 0,5 ms, sampling for around 10 secs, then to memorize the values in array.
how can I do?
0 Kudos
Message 1 of 8
(2,830 Views)
Tesi,

the AI timing is not going to be a problem since the acquisition will need a clock at 2 kSamples/Sec. The problems might be with the serial operations. Polling can be performed only at up to 1 ms (windows timing resolution) and the timing is not deterministic (again windows is not a realtime os).
Is there a particular reason why you need to read data at 0.5 ms from the serial port?
Regards,

AlessioD
National Instruments
0 Kudos
Message 2 of 8
(2,830 Views)
Sarebbe meglio per me riuscire ad acquisire ogni 0,5 ms; ma posso accontentarmi anche di 1 ms, sotto per l'applicazione che stiamo realizzando non ha senso andare perchè si perderebbe il controllo del fenomeno che studiamo. Accetto anche le limitazioni del sistema operativo.
Provo con un loop nel quale leggo il valore dell'ingresso AI e leggo la seriale, ma non mi funziona!
Se faccio girare il vi realizzato per leggere la seriale da solo in un loop funziona tutto bene, in uscita il valore ad ogni ciclo si aggiorna ecc..., nel momento in cui inserisco il vi di lettura della seriale all'interno del loop con cui leggo l'ingresso AI, non vedo più aggiornarsi il valore che leggo dalla seriale. Sai come posso fare, o meglio hai qualche esempio che fa al caso mio?
Ciao, Giovanni
0 Kudos
Message 3 of 8
(2,830 Views)
Hi,
I am interested in understanding why your loop that does Serial and Analog Input operations at the same time ives you problems.
Have you tried running the 2 operations in 2 parallel loops?
Can you attach here a simple example code that would allow me to see what is the problem you are experiencing?

Regards,
AlessioD
0 Kudos
Message 4 of 8
(2,830 Views)
Scusa per il ritardo con cui rispondo, ma mi sono dovuto dedicare ad altri lavori e adesso è veramente urgente per me riuscire a risolvere questa acquisizione.
Ti allego il vi quello da me realizzato, ma che non va.
Non provato a farli girare in due loops separati, ma in questo caso come posso sincronizzare le letture? Cioè come posso leggere la seriale e le analogiche contemporaneamente?
Grazie ancora, Ciao Giovanni
0 Kudos
Message 5 of 8
(2,830 Views)
Tesi,

I tried downloading your VI but the block diagram is Password protected.
Remember that if you have subscribed the SSP contract you are entitled to direct phone support and that would give you access to our Engineers.
Regards,

AlessioD
National Instruments
0 Kudos
Message 6 of 8
(2,830 Views)
Mi scuso per la password, una dimenticanza.
La password è: linux

ciao, Giovanni
0 Kudos
Message 7 of 8
(2,830 Views)
Attached you will find the example modified so that it works.
You should never initialize and close a VISA communication within a WHILE loop because this would waste a considerable amount of resources.

The example attached initializes and closes VISA sessions outside the WHILE loop.
Also, I have used a termination character = \n (or LineFeed) and tested it in a loopback configuration on my serial port (pin 2 and 3 shorted) and everything works

Regards,
AlessioD
National Instruments
0 Kudos
Message 8 of 8
(2,830 Views)