DI's clear DO's on same port using DAQmx DigWrite example

I'm adding support to a 6509 DIO board for an existing VB app.  I'm following the DAQmx DigWrite example.  I've created a button which writes DOs using the following code from the example:
' Create the DAQmx task.
DAQmxErrChk DAQmxCreateTask("", taskHandle)
' Add a digital output channel to the task.
DAQmxErrChk DAQmxCreateDOChan(taskHandle, txtChannelString.Text, "", DAQmx_Val_ChanForAllLines)
' Start the task running, and write to the digital lines.
DAQmxErrChk DAQmxStartTask(taskHandle)
DAQmxErrChk DAQmxWriteDigitalLines(taskHandle, 1, 1, 10#, DAQmx_Val_GroupByChannel, writeArray(0), sampsPerChanWritten, 0)
MsgBox "Samples per channel written = " & sampsPerChanWritten
' All done!
DAQmxErrChk DAQmxStopTask(taskHandle)
DAQmxErrChk DAQmxClearTask(taskHandle)
This works fine.  I've modified this code to read a DI, under a second button.  Works great.
However, if I set a DO (e.g.  Dev1/Port2/Line7) and then read a DI from the same port (e.g. Dev1/Port2/Line6), the DO is cleared as soon as the task is started to read the DI.
Is there some reason I can't mix DIs and DOs on a single port?  Thanks for your help.
(I posted this earlier on the Measurement Studio for .VSNET languages.  It belongs more properly here.  While I'm using VB.Net, we do not have Measurement Studio.)

This was answered on the other posting of this thread.
Regards,
Micaela N
National Instruments

Similar Messages

  • Two applications wants to read on the same port using Socket

    I have an application running on one machine using TCP/IP socket. The data transfer with the other application on other machine is in ASCII.
    Now I want a new application that can have a copy of data received and sent on the given port, where the previous application is running.
    Is it possible in Java using socket and TCP/IP to have two application reading data from the same port and both can read all the data.

    Even when you don't state the type of app which need to read the data stream (is it a server or a client app???), it's impossible to share a single TCP/IP socket among multiple apps.
    Perhaps the best thing to do is to develop something like a proxy server who listens on the nominated port and provides to contact (if your apps are server ones) or to be contacted (if your apps are client ones) by the desired apps.
    This way, the only job for the proxy is to duplicate the contents of the data stream and make them available to all the apps engaged.
    Hope this helps.

  • How do I open the same ports on an Airport Extreme Base Station for multiple computers at the same time?

    As the title suggests...
    I have a mix of five Mac and PC's at home using an Airport Extreme Base Station as the router.   I need many ports opened on the AEBS for all of the computers- not just one computer.  (for example: three people want to play TF2 on Steam at the same time; each machine needs the correct ports open on the router).   Port forwarding  only allows me to forward a given port to a single IP, yet I need that port open for five differnt IP's, all at the same time. 
    How do I do that on an AEBS?
    In the same way, I have a small office of four iMacs using an old airport with the same exact issue.   I would like to be able to connect to all of them remotely with Apple Remote Desktop, but the port forwarding on the airport only allows a port to forward to a single IP.   I want to be able to tunnel into the office network and log onto any machine behind the Airport extreme... not just a single IP.    I currently have it set up where I can tunnel into the office from my house, I can find the one machine that the port forwarding has been assigned to, I can log on and everything is just fine... with one machine.    How do I open the firewall for the other machines? 
    TL,DR version:  How do you open ports on an Airport Extreme Base Station instead of forwarding ports?   Forwarding ports doesn't work for multiple IP's.  

    You can open a single or multiple ports to a single device or different ports to different devices, but you cannot open the same port to multiple devices via the AirPort Utility for the Apple routers.

  • I want to Connect my Mac Mini as a Slave to a Mac pro Server while at the same time using the Mac mini's thunderbolt ports peripherals ( ie monitor, Sound Card, Hard drives) Creating a poor man's new mac Pro. Can this be Done?

    I want to Connect my Mac Mini as a Slave to a Mac pro Server while at the same time using the Mac mini's thunderbolt ports peripherals ( ie monitor, Sound Card, Hard drives) Creating a poor man's new mac Pro. Can this be Done?

    Well, I really would love the new unreleased mac pro however , I'm not sure of the expected cost , Everyone speculates from $3,000 to $8,000, in which I may have to wait a while to purchase.
    To the point .... I want fully functional thunderbolt ports to be on the current mac pro's .... wonder if anyone had workarounds yet?...  or could I chain the the current mac pro to a mac mini to make that happen?

  • Is it possible to use both an ILB and an ELB (listening on the same port) in the same Azure cloud service?

    I'm building a test Lync deployment on Azure; yes, I know this is not supported, hence "test".
    Lync Front-End servers expose two set of web services, one for internal users and one for external ones; they listen on different ports (443 and 4443) on the same servers; when external services are published, you need a reverse proxy or a port forwarding
    in order to map port 443 of a public IP address to port 4443 of the Front-End server(s). When you have multiple Front-End servers in a pool, you also need to load-balance them.
    So, a typical Lync deployment looks like this:
           Internal users
                     |
                   443
                      |
              Internal LB
            192.168.0.20
            443         443
              |               |
       Lync FE 1     Lync FE 2
    192.168.0.21 192.168.0.22
              |               |
          4443        4443
              External LB
           Public IP Address
                     |
                  443
                     |
           External Users
    This should be easily replicated in Azure, as it supports both external load balancing and internal load balancing. They are even supported together in the same cloud service, so this configuration should be easy. However, it looks like "should"
    is the keyword here.
    After creating the external load balanced endpoint (which listens on external port 443 and forwards to port 4443 on the servers), I'm trying to create an internal load balancer and add internal endpoints to is; however, while the ILB can be created successfully,
    adding an internal endpoint listening on port 443 and forwarding to port 443 on the servers fails miserably, with an error stating that port 443 is already in use by another endpoint:
    Update-AzureVM : BadRequest : Port 443 is already in use by one of the endpoints in this deployment. Ensure that the port numbers are unique across endpoints within a deployment.
    For reference, my commands are:
    Add-AzureInternalLoadBalancer -InternalLoadBalancerName "LyncILB" -ServiceName "LyncFrontEnd" -SubnetName "LabSubnet" -StaticVNetIPAddress 192.168.0.20
    (This completes successfully)
    Get-AzureVM LYNCFE1 | Add-AzureEndpoint -Name "Https-Int" -Protocol "tcp" -LocalPort 443 -PublicPort 443 -LBSetName "HttpsIntLB" -DefaultProbe -InternalLoadBalancerName "LyncILB"
    (This fails)
    The existing external endpoint is configured as such:
    Get-AzureVM LYNCFE1 | get-azureendpoint
    LBSetName : HttpsExtLB
    LocalPort : 4443
    Name : HTTPS-Ext
    Port : 443
    Protocol : tcp
    Vip :
    ProbePath :
    ProbePort : 4443
    ProbeProtocol : tcp
    ProbeIntervalInSeconds : 15
    ProbeTimeoutInSeconds : 31
    EnableDirectServerReturn : False
    Acl : {}
    InternalLoadBalancerName :
    IdleTimeoutInMinutes :
    LoadBalancerDistribution :
    The error doesn't even make a lot of sense; the external load balancer listens on a public IP address, while the internal load balancer listens on a private IP address in the internal network; there
    shouldn't be any conflict here... however it looks like there is one instead.
    Why doesn't this work? Am I doing something wrong, or is Azure networking just being silly as usual again?

    Hello Massimo Pascucci,
    The issue that you are facing when creating an endpoint with internal loadbalancer is the limitation of not allowing same ports to be listening under a single cloud service. This reason for this is that there is a limitation of only one private IP (Also
    known as the Internal load balanced IP) per cloud service.
    There is also a limitation on the Internal load balancer more than one port to be published per load balancer:
    You can leave your feedback by following the link below:
    https://social.msdn.microsoft.com/Forums/en-US/1805c5a0-3906-4cd6-8561-9802d77e0ae5/is-it-possible-to-use-both-an-ilb-and-an-elb-listening-on-the-same-port-in-the-same-azure-cloud?forum=WAVirtualMachinesVirtualNetwork
    Refer to this article for more information on Internal load balancer:
    http://azure.microsoft.com/blog/2014/05/20/internal-load-balancing/
    Thanks,
    Syed Irfan Hussain

  • Exporting two remote objects on the same port

    Hi,
    I would like to export two remote objects on the same host, same port and bind them with different service names.
    There is no problem when I do that from the same Java program.
    But when I export and bind an object from a Java program 1, I cannot do the same with the second (and similar) Java program 2. This is the stack trace of my Exception:
    java.rmi.server.ExportException: Port already in use: 50040; nested exception is:
         java.net.BindException: Address already in use: JVM_Bind
         at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
         at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
         at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
         at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:178)
         at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:75)Can some one help please

    It should work in any version of Java as long as the server socket factories are null or equal according to Object.equals() or its override in the SSF.equals() method if any. Which needs to be present and needs to take the form:
    public boolean equals(Object object)
      return object != null && object.getClass() == this.getClass();
    }with further tests if the server socket factories have additional state.

  • How to forward the same ports for multiple IPs?

    Hi all, I just bought a Linksys WRT54GS router and I would like to forward the same set of ports for two different computers on my network (192.168.1.101 and 192.168.1.3) however when I try to, I get a "Port Overlap" error. Is there another way I can do this? I am trying to set up Age of Empires II. Thanks for any help!

    No.  You cannot forward the same port to two different computers  (or IP addresses).  
    Here's the reason why:
    You and your friend are both playing the game online.  You score 1000 points.  Your friend scores 10 points.  The signal to increase your score 1000 points arrives on port 3078.  Which computer is the router supposed to send this signal to?  Both computers?   No way!
    Most online games have a way to assign different ports to different computers.  For example, you might use ports 3075 thru 3078, while your friend uses ports 3175 thru 3178.  If your game is setup this way, it should work.
    Also, you will want to forward ports to a fixed LAN IP address.  In your WRT54GS, note that any fixed LAN IP address must be outside the DHCP server range, and it cannot end in 0, 1, or 255.   So the 192.168.1.101  address is probably an illegal fixed LAN IP address.
    Here are all the Linksys rules for using fixed LAN IP addresses:
    With Linksys routers, a fixed (static) LAN IP addresses must be assigned in the device that is using the address. So you need to enter the fixed address in the computer or printer, not in the router.
    When using a Linksys router, any fixed LAN IP address must be outside the DHCP server range (typically 192.168.1.100 thru 192.168.1.149), and it cannot end in 0, 1, or 255.
    Therefore any fixed LAN IP address would normally need to be in the range of
    192.168.1.2 thru 192.168.1.99 or
    192.168.1.150 thru 192.168.1.254
    assuming you are still using the default DHCP server range.
    Also, in the computer, when you set up a static LAN IP address, you would need to set the "Subnet mask" to 255.255.255.0 and the "Default Gateway" to 192.168.1.1 and "DNS server" to 192.168.1.1
    It is also important that no two devices on your network be set to the same static LAN IP address.
    Typically, when I setup gamers, I put thier fixed addresses all together at 192.168.1.21 , 192.168.1.22, etc.   But you can use any legal fixed addresses that you want.

  • Multiple instances of WL on the same box :several Ip addresses using the same port

    Hi all,
    I want to set up several instances of WL on the same server. These
    instances will be clustered.
    I am using Apache for the WebServer.
    Here the configuration I used:
    I first change the weblogic.conf file in Apache to set up the bridge.I
    restart apache using apachectl.
    Then, on the WebLogic site, I created a new ipadress using ifconfig
    hme0:1 ip adress ...
    I created a file hostname.hme0:1 in /etc
    I added this Ip address in /etc/hosts.
    I added this Ip address in the mycluster DNS.
    I wanted to start both WL manually using startWebLogic.sh file to see
    the log file.
    So, I first assign hostname to WL1. Then start WL.
    I opened an other terminal. Assign the hostname to WL2. Then start using
    startWebLogic.sh.
    The first instance started correctly.When the second started, there was
    an error: when listening to the port 7001, this port was already used.
    That was the same with the port 7002.
    Then , my question is How is it possible to configure several instances
    on the same machine using several ip addresses and one port.
    Thank you for your help.
    Erwan

              Please try -Dweblogic.system.bindAddr=<a.b.c.d> in your startWebLogic.sh.
              Brian
              "Merg" <[email protected]> wrote:
              >> Then , my question is How is it possible to configure
              >> several instances on the same machine using several
              >ip
              >> addresses and one port. Thank you for your help. Eourwan
              >
              >On Win2K/WinNT you can assign several IP adresses to you
              >NIC. (Advanced
              >TCP/IP options.) Each server instance has to run on it's
              >own port.
              >
              >Regards,
              >Merg
              >
              >
              

  • Can you do Digital In or Out on the same port (byte) as PFI timing?

       I'm using an M series board with three digital ports.  Port 0 is only for DIO, ports 1 and 2 can be used for DIO or PFI (e.g. clocking, triggering).  My question is:  can I do both DIO and PFI functions on any one port.  For example, on Port 1, I would like to use bits 0 to 6 as Digital Inputs and have an external clock signal go into bit 7 as a clock for Analog Out.  Can the port be mixed like this?
    Thanks,
       Dave
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

    Dave,
    The DIO lines on any DAQ device that uses the DAQ-STC ASIC can be configured on a per line basis, so using PFI and DIO lines on the same port will work just fine. 
    You can run a quick test on this using the "Gen Dig Pulse.vi" example (found in the NI Example Finder under Browse -> Hardware Input and Output -> DAQmx -> Generate Digital Pulses).  You should be able to generate a pulse on one of the PFI lines on the board, then read that pulse back in on one of the DIO lines of that port using an external connection.
    -Justin

  • Strange behaviour: two servers on the same port

    Hi!
    I hope this is the right section for this post. I need help about a strange behaviour involving a ServerSocket.
    For my thesis I need to write a program that receives data from a pre-existing DSMS client, filters them and then sends them to a pre-existing DSMS server. And here is my problem: if I try to create a ServerSocket on the same port of the DSMS server, my program throws no exception, and the servers seem running on the same port. This is a behaviour that I'd like to avoid, but I cannot understand what the problem is. Can you help me?
    The source code of the DSMS server can be found here (it's written in C++): http://infolab.stanford.edu/stream/code/stream-0.6.0.tar.gz
    The source code of my server class, instead, is this one:
    import java.io.*;
    import java.net.*;
    public class ThreadGenerator {
         private ServerSocket server;
         public void connect(String servPort, String cHost, String cPort) {
              try {
                   server = new ServerSocket(servPort);
                   System.out.println("SERVER running on port "+servPort);
              } catch (BindException e) {
                   System.out.println("Address already in use!");
              } catch (Exception e) {
                   System.err.println(e);
              try {
                   while(true){
                        Socket client = server.accept();
                        StreamThread T = new StreamThread(client, cHost, cPort);
                        T.start();
              } catch (EOFException e) {
                   System.out.println("Server closed connection!");
              } catch (Exception e) {
                   System.err.println(e);
    }I'm programming on Mac OSX Tiger, with Java 1.5.0.
    Thanks in advance for your help.

    The problem is still happening to me, I tried in this very moment. The code I'm using is the one I posted, and the second server is the one that I linked. I don't think there's anything else to add.
    If you're sure that the problem is not in my code, then it means that it is in the linked server, which partially solves the problem. But I'd like to know, if it's possibile, if there is any other way to check if the port is already in use.

  • Two web servers cant use same port forwarding rule???

    I have two web servers, each configured to respond to http reqests on port 80.  I use NoIP service to map a domain name to my router. I create a port forwarding assignment for Server A by selecting the WebServer rule in the port forwarding rule table.  All is fine.  For Server B, I select the same Webserver rule and the router says there is a conflict.
    I don't understand why.  I think the router has enough information to route a http request for Server B by knowing its MAC address, which is different than Server A MAC address.
    What am I missing here???
    I was able to do this on my previous router with DD-WRT.....
    So it would appear the way to resolve this is to assign a different port address to Server B???
    grrrrrrrrrr I hate this router

    You shouldn't have been able to do that on any router.  You have to change the listening port of server 2, to 8080 or something like that, or make one a secure server and run it over 443
    That is a known issue with port forwarding
    Problem #8:
    Same Port in Multiple Rules
    There are some routers such as Linksys, D-Link and many others that do not do any checks if a port is already in another port forwarding rule. A port can only be forwarded to one Computer/IP at a time. So when there are multiples of the same port number the port forwarding rule will not work.
    Here is an example.
    As you can see port 2350 is in 2 rules. The 1st one points to a different IP than that of the 2nd rule. So the router will honor the 1st rule and the 2nd port forwarding rule to port 2350 fails.
    By removing the 1st rule the 2nd one will now work.

  • How to send to multiple people using same port?

    I am trying to have one person send TWO audio sources to 10 others using same port- lets say 12345. I get "Can't open local data port:" error. The first audio is fine since I just use .addTarget(). Is there a way i can do the same for the 2nd audio source still using the same port? thanks!

    As far as I know, you should transmit using even-numbered ports, eg. 22222 and 22224.
    I think a port numbered 22223 and 22225 are opened respectively to handle control information.
    Could be wrong, but try it anyway!
    StHogan

  • How to set up NAT for two servers using same port with ASDM ASA 5505

    Hi there,
    We have a new installation of a ASA 5505 and are trying to get some NAT issues straightened out. Here is the scenario: On our internal network, we have two servers running Filemaker Server, a relational database server that clients connect with using port 5003. Our goal is to be able to allow users from the outside to access either of these servers as needed. I know how to set up a simple static NAT rule and matching Access rule in ASDM which would be fine for a case in which only one server using a given port is running on a network, but for simple static rules I seem to be blocked from entering a different translated port number from the orginal port number, which becomes a problem when two servers we need to access from the outside are running software using the same port number.
    What is the simplest way to address this need? I am guessing that I need to set up a scenario like this, where port 5004 (or any arbitrarily choosen unused port, can be used to access the second server:
    Outside user enters   FQDN:5004  and this translates to Database server # 1 as   192.168.1.40:5003
    and
    Outside user enters   FQDN:5003  and this translates to Database server # 1 as   192.168.1.38:5003
    If so, what is the easist way to get this done? Or is there a better what to handle this scenario?
    Thanks in advance,
    James

    I would create two objects and use object NAT
    object network Obj_5004
    host 192.168.1.40
    object network Obj_5004
    nat (inside,outside) static service tcp 5003 5004
    object network Obj_5003
    host 192.168.1.38
    object network Obj_5003
    nat (inside,outside) static service tcp 5003 5003
    Of course you will need to open your outside interface for tcp ports 5003 and 5004 to make this happen

  • Broadcast and point to point server in the same port

    I'm trying to set up a system where I can send point to point messages via sockets to certain ips, send broadcast messages to every pc in the network, and also be able to listen for point to point messages and broadcast messages, all in the same port. I've been able to establish a point to point connection using the Socket class to send the message, and using the ServerSocket class to listen for messages, but I can't seem to get broadcasting to work.
    I read somewhere that for broadcasting one should use the DatagramSocket class. The problem is i'm not sure which ip i'm supposed to specify when I send the message. Also, do I need a special listener to listen for broadcast messages, or will the ServerSocket listener work for that?
    This is what I have for the broadcasting part:
    String msg = myId;
    DatagramSocket sendSocket;
    sendSocket = new DatagramSocket(Constants.COM_PORT); // 4567
    InetAddress group = InetAddress.getByName(Constants.BROADCAST_ADDR); // "192.168.1.1"
    DatagramPacket dp = new DatagramPacket(msg.getBytes(), msg.getBytes().length, group, Constants.COM_PORT);
    sendSocket.send(dp);
    sendSocket.close();
    Thanks in advance
    Diego

    It worth mentioning that UDP/broadcast and robust do go together easily.
    - UDP does not guarantee delivery. i.e. messages can be dropped and you won't be told. Lost packets are not retransmitted either.
    - UDP can fragment packets if larger than 532 bytes long.
    - UDP packets can arrive out of order (though I have never seen this myself)
    If your receiver is under load/busy it can miss many packets if its buffers overflow.

  • IDOC - XI - IDOC same port name in IDX1

    Hello,
    i have a problem in defining multiple receiver systems in IDX1.
    We have to send idocs to different system and some of them have the same SID.
    Receivers would have the same port name SAP(SID) ex : SAPPRD
    How could xi know which is the correct receiver port?
    Thanks,
    Laurent.

    Port name might be the same, but the RFC destination for each port is different. We use the the combination of port and RFC destination in communication also. Hence I guess there should not be any conflict.
    I may be wrong here. Correct me if am wrong.
    Regards,
    Jai Shankar

Maybe you are looking for