Jump to content
  • 0

Guida motore passo passo con USB-1208FS


Tullio83

Question

Buongiorno, sto cercando di comandare un uscita veloce per la generazione di un onda quadra risulta complicato imposturare una frequenza prestabilita c' è una funzione specifica ?

 

Risp = cbDOut(0, FIRSTPORTB, 1)

For X = 0 To 150000 Next X

Risp = cbDOut(0, FIRSTPORTB, 1)

----------------------------------------------- 

Good morning, I'm trying to command a fast output for the generation of a square wave is complicated to imposture a predetermined frequency there 'is a specific function ?

Risp = cbDOut(0, FIRSTPORTB, 1)

For X = 0 To 150000 : Next X

Risp = cbDOut(0, FIRSTPORTB, 1)

Edited by Fausto
Added translation
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hello @Tullio83.

The USB-1208FS does not support a hardware paced (clocked) digital output, only a software paced output as you have discovered.

https://www.mccdaq.com/pdfs/manuals/USB-1208FS.pdf

If a 0-4V square wave is acceptable for your application, then you can use the hardware paced analog output channel.  Fill your output data buffer with 0V & 4V values.  If developing in Windows, please reference the UL Help for the supported analog output scan function and examples.

https://www.mccdaq.com/pdfs/manuals/Mcculw_WebHelp/ULStart.htm

image.png

 

image.png

 

MCC Knowledgebase article:  https://kb.mccdaq.com/KnowledgebaseArticle50503.aspx

 

Regards,

Fausto

Edited by Fausto
Added MCC KB article.
Link to comment
Share on other sites

  • 0

Ciao Fausto, intanto grazie per la dritta, anche se mi trovo in difficoltà

La funzione che trovo é diversa de quella in descritta e gli esempi elencati non trattano AutoScan

Declare Function cbAOutScan Lib "cbw32.dll" (ByVal BoardNum&, ByVal LowChan&, ByVal HighChan&, ByVal CBCount&, CBRate&, ByVal Gain&, ByVal MemHandle&, ByVal Options&) As Long

Se mi puoi dare una dritta, te ne sono grato, e da poco che lavoro con queste librerie.

Grazie
 

-------------------------------------

Hello Fausto, meanwhile thanks for the tip, even if I'm in trouble

The function I find is different from the one described and the examples listed do not deal with AutoScan

Declare Function cbAOutScan Lib "cbw32.dll" (ByVal BoardNum&, ByVal LowChan&, ByVal HighChan&, ByVal CBCount&, CBRate&, ByVal Gain&, ByVal MemHandle&, ByVal Options&) As Long

If you can give me a tip, I'm grateful, and recently that I work with these libraries.

Thank you

Edited by Fausto
added translation.
Link to comment
Share on other sites

  • 0

Hello @Tullio83.

The example posted in the suggested MCC Knowledgebase article is a VB.NET example.  Which programming language are you using?

On your system with the installed MCC software, browse to the 'C:\Users\Public\Documents\Measurement Computing\DAQ\C\Sample32' directory for the 'C' examples and reference the 'ULAO02.C' example.

Regards,

Fausto

Link to comment
Share on other sites

  • 0

 

Ciao @Fausto!!!

Uso ancora VB6

 

Dichiara la funzione cbAOutScan Lib "cbw32.dll" (ByVal BoardNum&, ByVal LowChan&, ByVal HighChan&, ByVal CBCount&, CBRate&, ByVal Gain&, ByVal MemHandle&, ByVal Options&) As Long
 

Dim Onda_Quadra(1) As Integer
Dim Handle As Long

Onda_Quadra(0) = 0: Onda_Quadra(1) = 4095

Maniglia = cbWinBufAlloc(2)

Risposta = cbWinArrayToBuf(Onda_Quadra(0), Handle, 0, 2)

Risposta = cbAOutScan(0, 0, 0, 2, 100, UNI5VOLTS, Maniglia, &H3&)

 

Ho usato questo codice semplificato al massimo, se come opzione metto &H3& che sarebbe per la ripetizione con un frequenzimetro collegato all' uscita non vedo nulla se metto &H0& riesco ad attivare e disattivare l'uscita in base all'ultimo dato dell' array !

--------------------------------- 

 

Hello @Fausto!!!

I still use VB6

 

Declares cbAOutScan Lib function "cbw32.dll" (ByVal BoardNum&, ByVal LowChan&, ByVal HighChan&, ByVal CBCount&, CBRate&, ByVal Gain&, ByVal MemHandle&, ByVal Options&) As Long
 

Dim Onda_Quadra(1) As Integer
Dim Handle As Long

Onda_Quadra(0) = 0: Onda_Quadra(1) = 4095

Handle = cbWinBufAlloc(2)

Answer = cbWinArrayToBuf(Onda_Quadra(0), Handle, 0, 2)

Answer = cbAOutScan(0, 0, 0, 2, 100, UNI5VOLTS, Handle, &H3&)

 

I used this simplified code to the maximum, if as an option I put &H3& that would be for repetition with a frequency meter connected to the output I do not see anything if I put &H0& I can activate and deactivate the output based on the last data of the array!

Edited by Fausto
added translation.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...