PCI-DIO-96 & Visual Basic: Help

I am trying to control 96 relays with the PCI-DIO-96 and Visual basic but I
can figure out how to write to a PCI address from visual basic.
Thanks for your help
Raul
[email protected]
[email protected]

Install and Use Ni-DAQ. It will give you functions that you can use.
"Raul Quinones" wrote in message
news:[email protected]..
> I am trying to control 96 relays with the PCI-DIO-96 and Visual basic but
I
> can figure out how to write to a PCI address from visual basic.
>
>
> Thanks for your help
> Raul
> [email protected]
> [email protected]
>
>

Similar Messages

  • Visual Basic Help

    How do you correct an error that reads "Too many arguments to 'Public Sub New()'?
    Thanks Grammy Crum

    How do you correct an error that reads "Too many arguments to 'Public Sub New()'?
    Thanks Grammy Crum
    I bet I know what's going on. It's a guess, but it makes sense.
    If you've created a class and didn't explicitly create a constructor, it makes perfect sense. Have a look at the code and let me know if it's something like this please?
    Option Strict On
    Option Explicit On
    Option Infer Off
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    ' The following will give you the compile
    ' error that you're getting:
    ' =====================================================
    ' Dim mnc As New MyNewClass("this", "that", "theOther")
    ' =====================================================
    ' Here's how you can do it (one of two):
    Dim mnc As New MyNewClass With {.String1 = "this", _
    .String2 = "that", _
    .String3 = "theOther"}
    ' Another way:
    Dim mnc2 As New MyNewClass
    With mnc2
    .String1 = "this"
    .String2 = "that"
    .String3 = "theOther"
    End With
    Stop
    End Sub
    End Class
    Public Class MyNewClass
    Public String1 As String
    Public String2 As String
    Public String3 As String
    End Class
    The fact that my class ("MyNewClass") doesn't explicitly have a constructor, "Sub New" is created for you by the compiler. That can be confusing. If you're then trying to set the fields or properties, you can - as I show above - but not
    in the constructor.
    Make sense?
    ***** EDIT *****
    A third alternate, a better one, is that you create your own constructor which has those parameters. That way you can do validation - for example, to check that the parameters are valid.
    In my example that would be testing to make sure that the string isn't null or empty.
    You might then make Public Read-Only Properties and Private backing fields. Of course all of this is speculation until you give us some feedback here...
    Still lost in code, just at a little higher level.

  • Can I have a general daq event in visual basic while outputing in dma mode?

    Hardware: PCI-6711
    Software: Visual Basic 6.0
    NI-DAQ 6.9.3f3
    Windows 2000
    I can't get the GeneralDAQEvent_Fire subroutine to happen. I'm trying to output two synchronized waveforms on two channels at sampling rates that can be changed on the fly. To do this, I've set the clock source of the channels to be the GPCTR1. I output on a pulse train on the GPCTR1 and adjust the pulse widths to vary the frequency. I need to be able to switch to the new pulse width at a precise time so that the correct samples are output at the correct samplerate. I want to generate a general daq event which fires whenever a certain number of pulses (and thus samples) on the GPCTR1 have been output. I will
    then reset the event and output samplerate within the GeneralDAQEvent_Fire subroutine for the next section of samples. I need to output at up to 1 MSample/second, so I need to be using DMA mode. I have not read anywhere that DAQEvent 0 Aqcuired or Generated n Scans requires interrupt mode, am I wrong about this? I have set my Channel string to CTR1, does this reference the GPCTR1? I set the board, DAQTrigVal0 and enabled properties and then call the refresh method. Is there something else I should do?
    I have been reading the NIDAQ Function Reference Help and the NIDAQ for PC Reference manual and have not found a solution. Any suggestions? Also, where can I find info on what the ConfigureDaqEvent method is supposed to do?

    Roz,
    First of all, I think you will want to use DAQ Event 1 since you desire for a message to be sent after every N updates. This will be more efficient than removing the current message and adding a new message each time the event fires. Furthermore, DAQ Events 0-2 can all be used with DMA transfers. However, you will be unable to use a counter channel with DAQ Events 0-2. Instead you should use one of the analog output channel you are clocking with the counter's output.
    Good luck with your application.
    Spencer S.

  • I need help with motion control. I am programming in Visual Basic. I will need help with what parts I need to purchase from NI, along with help on the code.

    I am using a Papst servo motor and I need to know where to start and what to purchase to get this motor to spin. I am using visual basic and in my program I calculate the direction and RPM's needed from the motor. It will spin anywhere from 1 to 10000 RPM's. It seems rather easy, but I have no idea on how to spin the motor at the specific RPM, and stop it with a command stop in the program. Please help.

    We really should know a little more about your intended uses for this system, but assuming you want to do relatively simple (or even not so simple!) motion, you'll need a few components...
    A motion controller, such as the PCI-7342, can take your VB commands and turn them into the commands needed to "run" the motor. Next you'll need a drive, such as the MID-7342. This includes the servo amplifier that actually powers the motor. It also has connections to "pass through" the encoder signals from the motor back to the motion controller.
    The above-named pieces assume one or two axes of motion. You'll also need a cable to connect the two (can't remember the model right now). You can use MAX to configure the motion controller, and there are just a few VB calls you
    'll need to make using NI-Motion functions to define the motion and get it going.
    Hope this helps!

  • How can i write a pattern to a output port of NI PCI 6503 with Traditional NI DAQ 7.0 and Visual Basic 6.0?

    Hello, i'm using a NI PCI-6503 (with CB50LP accesory) to write digital patterns to one of the output ports. Can i do it directly from NIDAQ7.0?
    I know  some Visual Basic 6.0 functions to configure a par as output and to write a pattern to a port, but i don't know how run it.
    I've read some examples from "Help" (C:\Program Files\National Instruments\NI-DAQ\Examples\VBasic\Do) but I can't measuring TTL levels on my CB50LP accesory.
                    Thanks!!

    Hello,
    What is your buffer size ? The buffer should be 0 or greater than 2. You can get this error if your buffer size is equal to 1.
    Regards,
    Isabelle
    National Instruments France
    Isabelle
    Ingénieur d'applications
    National Instruments France

  • Look for visual basic 6.0 code for measuring audio signal in PCI 6052E card,such as THD(total harmonic distortion),signal-to-noise etc.

    Hope receive NI measurement studio with visual basic engineer's favor in a early date!

    This is just the nature of the while loop in the VB code. The processor is going to execute this loop as fast as possible. The DoEvents in the loop allows the processor to perform other operations if needed. Try opening MAX or some other program and drag windows around at the same time the code is executing. You will notice that the processor load will shift away from the VB6 program to other processes.
    If you want to avoid this try adding a function similar to sleep in the while loop. However, this will slow the speed of your program and I would not recommend it, because the program is designed to run as fast as possible, but still allow other programs to execute.
    I hope this helps.
    Joshua

  • Basic questions about PCI-DIO-96

    Hi
    I am trying to write code to control a digital I/O board for the first time.
    I have a legacy board, PCI-DIO-96, as the code implies, it is a PCI digital I/O boiard with 96 I/O channels
    My first question is, what would be the drivers and development platform I should download for this board?
    I am planning to write my code in C++.
    The second question is, I am trying to write a very simple application to drive 96 solenoid valves through the board.
    Basically I need to use the board in output mode only.  No data gathering here.
    The application basically needs to open and close these valves  for a specified number of milliseconds.  So basically,
    I would be sending either 0 or 1 through the output channels, that's
    it.    If I send a "1" signal through the board, does
    that
    "toggle" the channel, meaning the channel will keep sending "1" through the ouput until I send another signal, or do I need
    to send the "1" signal every few milliseconds to simulate a constant "1" signal?
    Does anyone have code samples or know where I can find code samples illustrating this simple case?
    It would be greatly appreciated.
    I realize these are very basic questions, but I am new to hardware programming and I am on a deadline.
    Thank  you
    Kiko

    Hi Kiko,
    Great to see that you are asking questions here first, you definitely came to the right place.
    Since you are starting with a clean slate as far as knowing how to use this board we can start off on the right foot. 
    Download the latest version of the drivers for your board.  You can find the drivers here: NI-DAQmx Version 7.5 for Windows 2000/NT/XP
    After you have downloaded the drivers, power down the computer,
    insert your board, and power it back up.  The board should now be
    recognized and the drivers will install similarly to any new hardware
    would in Windows.
    Now it's just a matter of learning how to use the commands that you need to get started.
    I would recommend starting in the example files.  You can find
    some excellent examples that should do almost exactly what you are
    trying to do by looking in this path:
    C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values
    Look for the example that best represents what it is you are trying to
    do.  You will notice that all of the examples have a general flow
    to how they call the board.
    Create a Task and Define what that task is meant to do
    Set the configuration for how exactly that task will operate
    Read/Write various values until a condition is met
    Close the Task
    Error Check all operations to assure that everything is working properly
    It's really not all that difficult and should you run into any problems or errors don't forget to search ni.com or the forums to see if others have run into similar issues to what you are facing.
    Regarding how the states for digital lines work.  The short answer
    is that if you set a digital line to high it will stay high until you
    set it back to low and vice versa.  For more details on everything
    digital check out our Digital Fundamentals page.
    Best of luck!
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • Need help creating full battery alert using visual basic script

    Hi,
    I have been searching for resources, programs and code that will create an alert for me to unplug my charger when my laptop
    battery is charged to full (or almost full).
    The only problem with this code is that
    Line 13: iRemaining (or RemainingCapacity called from BatteryStatus returns a 0 (might be a floating point which I can't figure out why). I even checked the microsoft documentation and its supposed to be a percentage.
    I want to get either the current percentage of the battery or the total Fullchargedcapacity and the EstimatedRemainingCapacity to find the % of battery level.
    Essentially what I am asking is how can I return the battery % using visual basic script.
    Help!
    The Code:
    1 set oLocator = CreateObject("WbemScripting.SWbemLocator")
    2 set oServices = oLocator.ConnectServer(".","root\wmi")
    3 set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")
    4 for each oResult in oResults iFull = oResult.FullChargedCapacity
    5 next
    6
    7 while (1)
    8 set oResults = oServices.ExecQuery("select * from batterystatus")
    9 for each oResult in oResults
    10 iRemaining = oResult.RemainingCapacity
    12 bCharging = oResult.Charging
    12 next
    13 iPercent = ((iRemaining / iFull) * 100) mod 100
    14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
    15 wscript.sleep 30000 ' (30 seconds)
    16 wend

    14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
    On my Windows 7 machine your script returns the desired percentage (after adding the missing "&" to the right of "iPercent" in Line 14).

  • PCI-GPIB Card with Visual Basic gives blue screen and re-boots PC

    The application makes the "ibsic" call then "ibln" to find devices on the bus. Running the VB program the first time is fine, but if you end the program and re-run a second time, you get a blue screen and the PC reboots when the program reaches the lines that make the first call to the NI-488 functions. If you close out of VB and then restart VB, everything is OK again.
    What is wrong?

    Hi,
    Here's an article that describes the most common blue screen when using VB:
    Why Does My Windows 2000 or XP System Crash When I Use Visual Basic to Program GPIB?
    Hope this helps
    DiegoF

  • Auslesen der 16 Analogkänale der Multi-IO Karte NI PCI-6036E mit Hilfe Visual Basic

    Guten Tag,
    Ich bin dabei ein Visual Basic Programm zu schreiben, welches bei der Multi-IO Karte "NI PCI-6036E" die Analogkanäle einlesen soll. Ab den Kanal ACH 8 bekomme ich immer eine Fehlermeldung:
    "Laufzeitfehler 10007
    Reading Data
    A channel, port, or counter is out of range for the device type or device configuration;…".
    Ich kann also nur die ersten acht von den 16 Analogkanäle einlesen. Als Vorlage habe ich mir das von NI mitgelieferte Beispielprogramm "AIAOPoint" genommen. Welches sich in den Ordner "..\Programme\National Instruments\NI-DAQ\Examples\Visual Basic" installiert hat. Bei diesem Programm liegt der gleiche Fehler vor.
    Liegt es daran, dass ich eine Freewareversion von den Visual Basic Komponenten benutze? Wenn ja, ab welcher Version wäre mir geholfen und wo bekomme ich sie her? Oder muss ich unter VB noch einige Eigenschaften bei der Komponente "CWAIPoint" einstellen um die vollen 16 Kanäle auszulesen zu können?
    Mit freunlichem Gruß
    Dirk Malczan
    P.S. ich würde mich auch über Quellcode freuen ;-)

    Das Problem wird durch den Messmodus verursacht. Sie messen differentiell. In diesem Messmodus werden immer zwei Eingangskanal zur Messung eines Eingangssignals genutzt (0 und 8, 1 und 9, usw.), so dass insgesamt nur 8 Eingangskanäle zur Verfügung stehen. Der Vorteil dieses Messmodus ist die erhöhte Störsicherheit.
    Wollen Sie alle 16 Kanäle nutzen, müssen Sie entweder Referenced Single Ended (massebezogen) oder Non Referenced Single Ended messen. Diese Einstellung können Sie z. B. im MAX vornehmen.
    Mit freundlichen Grüßen,
    Jochen Klier
    National Instruments Germany

  • Help me plz: Connect to tuxedo from visual basic 6.0 client application

    Hello everyone,
    i have a big problem
    i try to connect my visual basic application 6.0 to the tuxedo, but i dont know how to use tpinit and tpcall in vb environnement.
    that my code:
    Private Declare Function tpinit Lib "C:\OracleHome\tuxedo11gR1\bin\wtuxws32.dll" _
    (ByVal vlTpInfo As Long) As Integer
    Private Declare Function TpTerm Lib "C:\OracleHome\tuxedo11gR1\bin\wtuxws32.dll" Alias "tpterm" () As Integer
    Private Declare Function TpCall Lib "C:\OracleHome\tuxedo11gR1\bin\wtuxws32.dll" Alias "tpcall" _
    (ByVal vsServiceName As String, ByVal vlBufPtr As Long, ByVal vlBufLen As Long, _
    ByRef rlReplyBufPtr As Long, ByRef rlReplyBufLen As Long, ByVal vlFlags As Long) As Integer
    Private Declare Function TpAlloc Lib "C:\OracleHome\tuxedo11gR1\bin\wtuxws32.dll" Alias "tpalloc" _
    (ByVal vsTpType As String, ByVal vsTpSubType As String, ByVal vlSize As Long) As Long
    Private Declare Sub TpFree Lib "C:\OracleHome\tuxedo11gR1\bin\wtuxws32.dll" Alias "tpfree" (ByVal vlBufPtr As Long)
    Option Explicit
    Type tpinfo_type
    username As String
    cltname As String
    passwd As String
    flags As Long
    datalen As Long
    data As String
    End Type
    Dim tpinfo As tpinfo_type
    tpinfo.username = "cajat05"
    tpinfo.passwd = "cajat05"
    tpinfo.cltname = "VB6"
    tpinfo.flags = 110
    tpinfo.data = "NMLRS 55502022"
    tpinfo.datalen = 14
    Dim ret_init As Integer
    Dim ret_tpalloc As Long
    ret_tpalloc = TpAlloc("tpinfo", "", 9000)
    MsgBox "ret_tpalloc = " & ret_tpalloc
    'ret_init = tpinit(900)
    'MsgBox "ret_init = " & ret_init
    Dim s As String
    If ret_init = 0 Then
    msgbox "good"
    Else
    msgbox "not good"
    End If
    Can any one send me the code he made for a similar case ?
    Thank you in advance.
    Edited by: user3465258 on 2 août 2010 14:57
    Edited by: user3465258 on 2 août 2010 15:44
    Edited by: user3465258 on 2 août 2010 18:00

    As an alternative you may want to consider writing a "C" DLL that is callable from VB. The DLL would make the Tuxedo "tp" calls and check all the return codes and the functions defined in the DLL would simplify the interface to VB. I have done this successfully in the past.
    Harvey

  • Can anyone help i want to call java class using visual basic

    I want to call java class using visual basic and send some arguments to the main class

    Hi,
    I don't know VB, but you can surely launch a command line like :
    javaw.exe mypackage.MyMainClass myArgument1
    Regards

  • Help visual basic users need help with compiling a .dll!!

    I just need someone to compile this .dll for me please since i dont have a visual basic. Thanks in advance!
    link: http://shrib.com/1Lso3eMG
    It's an online notepad I used to compile a little script for something. Please and thank you!

    Hi,
    Perhaps you can use this:
    https://msdn.microsoft.com/en-us/vstudio/hh388573
    As this question is not reporting an issue with the forums, I'll move this thread to the 'Where is the Forum For...?' forum.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Need help with Visual BASIC

    I am in an intro to programming course, and I am writing a console on Visual Basic 2013.  My problem with Visual Basic right now is that I cannot get the formula to work.  All of my inputted values end up being 0's.  Am I using incorrect parameters,
    am I misunderstanding how to use arguments; am I not coding correctly?  The scenario for my problem is:
          Areas of Rectangles: The area of a rectangle is the rectangle’s length times its width.  Design a program that asks for the length and width of two rectangles. The program should tell the user which rectangle has the
    greater area, or if the areas are the same.
    //My code is 
    Module Module1
        Sub Main()
            Dim LENGTH As Double = 0
            Dim WIDTH As double = 0
            Dim AREA_1 As Double
            Dim AREA_2 As Double
            Dim RECTANGLE As String = " "
            area1(LENGTH, WIDTH)
            areaCalc1(AREA_1, LENGTH, WIDTH)
            area2(LENGTH, WIDTH)
            areaCalc2(AREA_2, LENGTH, WIDTH)
            decision(AREA_1, AREA_2, RECTANGLE)
            displayDec(RECTANGLE)
            Console.WriteLine("Press any key to exit...")
            Console.Read()
        End Sub
        Sub area1(ByVal LENGTH, WIDTH)
            Console.WriteLine("Please input the following for your first rectangle:")
            Console.Write("Length: ")
            LENGTH = Console.ReadLine()
            Console.Write("Width: ")
            WIDTH = Console.ReadLine()
        End Sub
        Sub areaCalc1(ByVal AREA_1, ByRef LENGTH, WIDTH)
            AREA_1 = LENGTH * WIDTH
            Console.WriteLine("This is the area for rectangle 1: " & AREA_1)
        End Sub
        Sub area2(ByVal LENGTH, WIDTH)
            Console.WriteLine("Please input the following for your second rectangle: ")
            Console.Write("Length: ")
            LENGTH = Console.ReadLine()
            Console.Write("Width: ")
            WIDTH = Console.ReadLine()
        End Sub
        Sub areaCalc2(ByVal AREA_2, ByRef LENGTH, WIDTH)
            AREA_2 = LENGTH * WIDTH
            Console.WriteLine("This is the area for rectangle 2: " & AREA_2)
        End Sub
        Sub decision(ByRef AREA_1, AREA_2, ByVal RECTANGLE)
            If AREA_1 < AREA_2 Then
                RECTANGLE = "rectangle 2"
            Else
                RECTANGLE = "rectangle 1"
            End If
        End Sub
        Sub displayDec(ByRef RECTANGLE)
            Console.WriteLine("The rectangle with the greater Area is " & RECTANGLE)
        End Sub
    End Module

    Hi,
      If you are just beginning to program i highly recommend setting the following options in the Visual Studio menu (Tools/Options). Open the Options window and go to the (Projects and Solutions) and click on (VB Defaults). Now set the options as follows.
    Option Strict - On
    Option Explicit - On
    Option Infer - Off
     And probably one of the most important things to do is learning to Debug your code. That will save you hours of headaches when you get unexpected results in your applications. You will know how to track it down and find where in the code your results
    are being thrown off. There are quite a few Debugging tutorials on the internet. Here are a few decent ones.
    Debugging Express
    Breakpoints and Debugging Tools
    If you say it can`t be done then i`ll try it

  • URGENT HELP :WEBSERVICES - VISUAL BASIC/POWERBUILDER

    CAN AN APPLICATION BUILT USING VISUAL BASIC(APP A) OR POWER BUILDER(APP B) MAKE A WEBSERVICE CALL TO A JAVA APPLICATION.THE REQUIREMENT IS..APP A & APP B SHOULD TALK TO A JAVA BASED APPLICATION BY PASSING INPUTS AND THE JAVA APP PROCESSES THE INPUTS AND SENDS BACK THE OUTPUT TO APP A & APP B.
    IS THIS POSSIBLE USING JAVA WEBSERVICES? IF YES..HOW? ELSE ANY WAY OUTS?
    -IK

    IK,
    A new XML/JAVA adapter for Visual Basic and PowerBuilder (named ActiveEC) can accomplish the integration scenario you describe. From the product site:
    "With no PB or VB code changes or migration, ActiveEC instantly creates XML ?black boxes? for existing PowerBuilder and Visual Basic applications, enabling them to communicate with portals, Web services, business process compositions and other applications. All PB/VB application security and integrity is maintained, and the existing applications can continue to be used through the native PB/VB interfaces. The unique part of the technology is that it requires no changes to the underlying application code, so it can be used easily and safely with "legacy" client/server apps. This technology instantly discovers all application and screen controls to deploy reliable, complete Web services. Once you deploy an ActiveEC service, you can invoke this service through the following standard interfaces: Web service, EJB, JMS, .NET assembly"
    http://www.active-endpoints.com/products/activeec/index.html
    HTH,
    A.J.

Maybe you are looking for

  • Check while creating PR with account assignment K

    Hi Gurus, Can I put a check while creating PRs for account assignment category K, that only statistical order number range is allowed. In other words, user should not be allowed to put any internal order other than statistical order in PR, while crea

  • .PDF file transfer(SAP XI ) along with file name to SAP R3

    I would like to transfer a .PDF file along with its file name to target system.I need to have target structure like,   <Target>     <field1>     <Field2> /Target> Field1should be mapped to file name( i can do this by using dynamic configuration and a

  • Read entire URL with WD

    Hi @ all, I have to do some upgrade work for my WD application from 6.4 to version 7.0 I have some codings that don`t work anymore, where the Request URL was read out like this way: HttpServletRequest request = (HttpServletRequest)WDProtocolAdapter.g

  • Invoke JCAPS webservice from Java Application

    I am getting AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: JAXRPC.TIE.01: caught exception while handling request: unrecognized operation: Test faultActor: faultNode: faultDetail: {http://xml.apache

  • Jumping of reports by using RRI

    Hi Gurus Can anybody help me in getting the scenarions for RRI, when it is usefull on what scenarios wego for RRI