Send data and receive commands by VBAI of VB or c#

Hi, anyone has examples on how to send VBAI data and receive commands by VBAI of VB or c#.

I intend to hand over command to the VBAI on and outside, get the image and stop start.

For the data to be send are the result of the calculation of the calculator function. The data send each time to do the math.

I have search the forum and I know that this can be done by using labVIEW. However, due to the requirement of the question, I can't do it using labVIEW.

Thank you.

Yen

Hi Yen,

"" "You're almost there. '" Here are the steps for this example works.

Once you open the inspection in Vision Builder, go to tools > Communication Device Manager...

You must create a Modbus master device, which corresponds to your communication of VB with Vision Builder application.

Click on the new device. Give it a name, say "VB program".

Select Modbus TCP for the Protocol.

Click OK.

On the Modbus server line, click Start Server. This starts the background task which is listening on port 502 for incoming Modbus messages.

Click OK to exit the dialog box.

Now, a couple of things to understand about Modbus: the Protocol specifies how a device Modbus master can read and write registers located on a slave device. Vision Builder has 4 64 k save tables:

-Coils (read/write binary, by the master).

-Tor inputs (binary, not read by the master).

-Entrance to the registers (16 bits, not read by the master).

-Holding Registers (16-bit, read/write by the master).

The tolerances of the inspection reading read minimum and maximum intensity in Modbus 0 x 0 and 0 x 1 operating records.

If you want your VB application to write these values.

Here's the Modbus function codes. You can get the full list by downloading the specification to Modbus.org Modbus.

0 x 01 reading reels

0x02 read discrete inputs

0 x 03 playback record keeping

0x04 read input registers

0x05 write single coil

0 x 06 write single register

0x0F write multiple coils

0x10 write multiple registers

To use your example Modbus program to read and write registers Vision Builder, first enter the IP where Vision Builder is running:

127.0.0.1 (localhost)

For this example, use the function Code 6 to write a single business registration.

The Modbus data must be formatted as follows: the first 2 bytes are the starting address, the following 2 bytes are the value (U16) you want to write to the registry. So to write the value 1 at 0 (corresponding to the intensity of the min), the data value Modbus 00000001. Click on send.

Now, to set the maximum intensity at 50. Set the data to 00010050. Click on send.

Step write data written minimum intensity of step to check the presence of CAP in the Modbus 0 x 0 registry entry and the status of the step in discreet entrance 0 x 0.

To read the intensity Minimum written by VBAI, the value of the function 4 Code (enter reading registry). For the Modbus data, the first 2 bytes represent the address, 2 bytes, the number of registers to read. The value of data Modbus 00000001 to read a single registry entry to address 0. Click on send. The response data can be for example 0x1E, which corresponds to 30 decimal places.

To read the status of the step, set the function Code 2 to read discrete inputs. The value data 00000001, to read the first register of the discreet entry table located at address 0. The response data is 0 or 1 (success or failure).

I hope this helps. Let me know if you need other information. But this should help you get started.

Best regards

-Christophe

Tags: NI Hardware

Similar Questions

  • On the forms send us and receive in return, data in the form of fields will be not print.  We can view the data, but the fields to print Virgin.  How can I fix it?

    On the forms send us and receive in return, data in the form of fields will be not print.  We can view the data, but the fields to print Virgin.  How can I fix it?

    OK, it's different. These text boxes are (at least engineering point of view) not considered form data, they are annotations (or markup). On your print dialogue box, you will see a group of "Comments & Form". Make sure that the first control is set to "Document and annotations:

    After this change, you should see the markup of your impressions.

  • My local network is not sending data but receiving. I am not able to connect to internet

    My local network is not sending data but receiving. I am not able to connect to the internet. No problem on my side of the seller.

    conduct a search on the internet, nothing works

    Hi Kaushal,

    1. What is the accurate and complete error message you get?
    2. don't you make changes to the computer before the show?
    3. which antivirus is installed on the computer?

    I suggest you try the steps from the following link:

    Why can't I connect to the Internet?
    http://Windows.Microsoft.com/en-in/Windows7/why-can-t-i-connect-to-the-Internet

    Come back and let us know the State of the question, I'll be happy to help you. We, at tender Microsoft to excellence.

  • I can not find send it and receive button on my outlook express.

    do not send and receive in outlook express

    I can not find send it and receive button on my outlook express. Opening of the express shortcut icon outlook, it provides options for awhile but it disappears. Can you help me to get the instructions to recover send it and receive button pls.

    You may have a damaged identity especially if it's the default main identity. File | Identities | Add the new identity. Create a new one and try it. If all goes well, you can import your messages and address book from the old identity and delete it.

    Note: Do not use the main word in the name of the new identity.

  • Sending data and downloading a file using as3.

    Hello

    I have a job application form where I users basic info such as name, email, phone not with this I'm asking him to download his CV (file doc ang)

    How can I publish all the data on one subject. I use PHP on the backend.

    I can send data and download file separately. ISIT possible to download the file and submit data at a time.

    Can I send additional variables with the file reference object.

    Hi guys

    I found the solution to

    http://www.flepstudio.org/Forum/flepstudio-utilities/2265-email-form-pictures-Flash-CS3-pH p.html

    Take a peek inside.

    Thank you

  • My (new) mobile phone number is not reflected in send it and receive for imessage and even in facetime

    I received the new SIM for my iphone. But I can not activate my imessage and Facetime. And the new number in the "send and receive" in imessage and facetime

    Hello

    Go to settings until the second phone icon click then my high number of page change number to correct a.

    See you soon

    Bria

  • sending data and reading

    Well guys, I have a problem sending data here.

    When I did which is left in a loop, it works!

    But when I did what is the Chief while loop, I received a large number of values of fools.

    Could someone help me on this?

    The second loop, I had only a few simple calculations for the example. So don't you worry with math or anything so.

    In the logic... the good is that I receive the correct value in table annexed bouth. The only thing that will change is 3 last numbers!

    If anyane can help me on this, I'll be happy!

    EduU wrote:

    Well guys, I have a problem sending data here.

    When I did which is left in a loop, it works!

    But when I did what is the Chief while loop, I received a large number of values of fools.

    This is because you have a status of critical competition due to your use of local variables. In the second loop, the instance of the local variable is read before you actually wrote the new value of the indicator. You can browse this thread.

  • I want to display send them and received messages in a thread

    Messages are threaded but send messages on the same topic do not appear in the threaded list.

    https://addons.Mozilla.org/en-us/Thunderbird/addon/Gmail-conversation-view/?src=SS

    This add-on may be

  • My outlook keeps send them and receive, but not in the normal way.

    The progress window shows that it is dealing with thousands of tasks - 7 2,7902, 1 700 or other random numbers. When this happens the rest of my programs virtually close or open start floating screen. and as I have a sony vio fan in starting the computer hum loudly looks like a plane on takeoff.

    Has anyone encountered such a thing before? It is a nightmare and really interrupts my work.

    Interestingly, it seems to happen in the office. Happening at home, and it happens when I'm traveling.

    the company that hosts my email to the United Kingdom making sure that there is nothing to do with them. my ISP says there's nothing to do with them.

    Help. Anyone?

    Hi Elizabeth,.

    The question you posted would be better suited in the TechNet Forums; We recommend that you post your question in the TechNet Forums to get help:

    http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/threads

    If you need Windows guru, do not hesitate to post your questions and we will be happy to help you.

  • Niether can send and receive in Outlook Express.

    My computer crashed about 2 years ago. After restoring the computer and reload the essential programs, I found that I could not send emails and receive only. This has been acceptable to date because I use my laptop 90% of the time (where my email address works correctly with Windows 7 Professional). However my current system on my console is Windows XP and the mail is Outlook Express 2002). When I was earlier today downloading hundreds of my email address the system simply stopped with an error messge. See attachment: an unknown error has occurred. Account: 'incoming.verizon.net', server: 'incoming.verizon.net', Protocol: POP3, Port: 995, secure (SSL): Yes, error number: 0x800C0133. I am connected to the internet through Verizon FIOS and have checked with them that their link with me is not the problem that I can get the email on their website. Help, please.

    Error number: 0x800C0133 = a corrupt Inbox.

    Move any message you want to save to a local folder that you create. Then, remove the problem of Inbox as follows.

    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.

    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder options | View.

    With OE closed, find the box of Inbox.dbx and delete it. Another will be created automatically when you open OE.

    General precautions for Outlook Express:

    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.

    After you're done, followed by compacting your folders manually while working * off * and do it often.

    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.

    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the processors and causes a multitude of problems such as time-outs and account setting changes. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3

  • How to synchronize two timers that send data?

    Hi, I have a problem:

    I have a thread in which I have two timers with timerTask. two of them will send data on the server. the first 5 sec every one and the all other the 1 sec the problem is that when I run the defective computer application (disconnection with an IOException error) after 3-4 sec, I think it's probalby because in an instant, both of them are trying to send data and can only be in one second. I tried to create both a dataOutputStreams but this is not enough. Here is my code:

    //in my thread, run method:
    
    public void run(){
    
     synchronized(_firstTimer){
    
    //send data every 5 sec
    _firstTimer.scheduleAtFixedRate(new TimerTask(){
    
     public void run(){
       sendData(_data1);
    }
    },0, 5000);
    }
    
    while(true){
    
      synchronized(_secondTimer){
    
    //send data every second
      _secondTimer.scheduleAtFixedRate(newTimerTask(){
    
            public void run(){
    
         sendData(_data2);
    }
    
    }, 0, 1000);
    }
    
    }//end of while
    
    }//end of run()
    
    //and sendData() method:
    
         public boolean sendData(byte[] _b){
                int length = _b.length;
    
                try{
                    _os.write(_b, 0, length);
                    _os.flush();
    
                    return true;
                } catch(Exception e){   return false;   }
    
            }//end of sendData method
    
    //where before in the code i've got:
    SocketConnection _s = (SocketConnection)Connector.open(_address);
    _os = _s.openDataOutputStream();
    

    can someone please provide all my advice how to fix this?

    Kind regards

    a solution would be a 'executable queue", a vector that contains objects that implement the runnable interface and executes one by one.
    the two timertasks add their treatment to the queue (synchronized) and directs the queue.

    It is a lot of material on threads synchronization available on the net because it is one of the most basic problems of treatment / distributed computing.
    I'm sure you can find detailed examples to sun.com and many other java sites.

  • LabVIEW TCP/IP Client and server, I need to send commands and receive comments side server from the client regarding the command sent.

    Hi all

    I can configure my two PCs, one as a client and a server very well. I am able to send commands from the server to the client. However, I am trying to determine how I can get feedback from the client to the server that something has changed, or a CQI that the command has been received. How I can do this in LabVIEW with the box to TCP/IP tools, or is there a better way to do it?

    Thanks for your help!

    Best regards

    -Gmac

    Once the connection is established, TCP does not care which end is the 'server' and the 'customer '. Data can be sent in both directions using the same read and write functions. So, if you are already able to send data to the client and read on the server, you should be able to do the same to send data from the server to the client, using the same TCP connection.

    If this is not clear, please your postal code so that we can provide more specific advice.

  • Is anyone having problems with their 6 s new more not to send and receive images through text messages unless your cell data are lit?  Even if I'm on wifi, I won't get it the pic unless the cell data is on?

    Is a person with problems with their new 6s more iPhone send and receive pictures via SMS?  Even if I'm on WIFI, I have my cellular data button turned to receive a picture. Then in turn instead to use WIFI, it devours my data plan. If to halfway through the month I get warnings that my data plan has almost disappeared. I did everything, including resetting the phone to factory settings. It also does not send a text if IMessage is turned on. It switches immediately to Imessaging which of course, again use my data plan. Of course, I could use some help with this. BTW, my text messaging service is connected to my phone number and not my email. Who was one of the suggestions that support Apple told me to check. Never in my life have had so many problems with a phone since I bought this iphone 6 s.

    Mgibson2425 wrote:

    Is a person with problems with their new 6s more iPhone send and receive pictures via SMS?  Even if I'm on WIFI, I have my cellular data button turned to receive a picture. Then in turn instead to use WIFI, it devours my data plan. If to halfway through the month I get warnings that my data plan has almost disappeared. I did everything, including resetting the phone to factory settings. It also does not send a text if IMessage is turned on. It switches immediately to Imessaging which of course, again use my data plan. Of course, I could use some help with this. BTW, my text messaging service is connected to my phone number and not my email. Who was one of the suggestions that support Apple told me to check. Never in my life have had so many problems with a phone since I bought this iphone 6 s.

    SMS is a function of the carrier, you will need to contact your cell phone provider and see what is the matter.

    IMessage uses very little data.

  • Send and receive data via the Ethernet Port?

    Hello

    I am trying to acquire details of LAN/Ethernet from the PC through LabVIEW.Like details, we get the date & time, etc Serial Port system, is it possible to get the details of my PC via LabVIEW.My LAN aims to sebd and Receive via Ethernet Port command.

    The last time I did it, I used the range of tcp. (I go ctrl + space for quick menu then type tcp). Open a connection to the network device, and then use tcp read/write, depending on the case. There are examples that can be very useful

  • I am new to the ethernet communication using labview. I don't have any material. I have two laptop, I need to send and receive data through these 2 portable by using labview. Kindly help me on this.

    I am new to the ethernet communication using labview. I don't have any material. I have two laptop, I need to send and receive data through these 2 portable by using labview. Kindly help me on this.

    Dennis has already said: for a direct PC - PC connection, you need a cross over cable. If you connect through a router or a switch, you use a standard cable.

Maybe you are looking for