01-16-2009 02:08 PM
Hi there
I am trying to access and get data from a NI USB6210 throuhght VISA.
By now, my goal is simply to get some fast (high sample rate) waveform triggered by a digital input like PF1.
Up to now my best approximation is the attached code based on the VISA help.
Can anybody help me explaining what functions (and parameters) I need to
use to achieve the above goal?
There is any source of complete C examples to access this USB6210 using VISA?
Regards
César Bravo
01-16-2009 02:12 PM
Develop platform:
PC running OpenSuSE 10.3, Linux 2.6.22.5-31-default i686
Processor (CPU): AMD Athlon(TM) XP 2000+ Speed: 1.261,31 MHz
RAM: 504,1 MB
HD 80G
USB 1.0 physical port
Production platform
Industrial PC VIA, running OpenSuSE, Linux 2.6.22.5-31-default i686
with CELERON processor 700Mhz
USB 2.0 physical port connecting through PCI bus
01-16-2009 02:37 PM
01-21-2009 11:00 AM
César -
I know that both Visual Studio and Measurment Studio com with C code examples.
Below is a knowledge base article where you have the location of C code examples.
I hope this helps.
Best Regards
Bruno Noronha
01-21-2009 01:42 PM
Olá Bruno
Obrigado pela resposta mas o link NÃO FUNCIONA.
Aliás, estou querendo usar o acesso VISA para acessar o NIUSB6210 em openSuSE Linux.
Então: qualquer idca sobre como proceder nessa plataforma ajuda.
At+,
César Bravo
01-22-2009 05:25 AM
César -
Desculpe te mandei o link interno.
O link é este: http://digital.ni.com/public.nsf/allkb/E0D14AB889CBF8E5862572B8006B22D3?OpenDocument
Aqui você terá todos os exemplos em C que a NI disponibiliza.
Analisando o link que você mandou eu creio que já te passaram este link anteriormente.
Eu ajudei uma pessoa a fazer uma comunicação com um USB PIC faz um tempo e lembro que ele também teve problemas com a função viOpenDefault.
Tente o seguinte:
#include <visa.h>
#include <ansi_c.h>
static ViSession defaultRM, instrHandle;
static ViStatus status;
static char buffer [100];
void main ()
{
//Para abrir o Default Resource Manager
status = viOpenDefaultRM (&defaultRM);
//Depois temos que abrir uma sesão no instrumento com que desejamos fazer a comunicação.
//Onde esta escrito "GPIB::02::INSTR" substitua por o descriptor do instrumento
viOpen (defaultRM, "GPIB::02::INSTR", VI_NULL,VI_NULL,&instrHandle);
com isto você pode utilizar as funções viRead e viWrite para fazer a comunicação com os dispositivos do VISA. estas funções sabem com que instrumento devem comunicar devido ao instrHandle retornado pela função viOpen
Eu sei que com isto foi possível fazer a comunicação com um Dispositivo USB sem problemas (ele usou C++).
Não sei muito bem como fazer um trigger darei uma pesquisada e ao encontrar algo volto a postar aqui.
Boa Sorte
Bruno