WSMBT Modbus & wsmbs Modbus control and registration machine

Source: Internet
Author: User

First on the registration machine click Download How to add the Wsmbt control to the Toolbox:
    1. On the Tools menu, click Choose Toolbox Items.
    2. Click Browse. The open dialog appears.
    3. Browse for the Wsmbt.dll
    4. Click OK in the "Choose Toolbox Items" dialog box.
    5. Now you can find the WSMBT control in the Toolbox.
    6. Add the Wsmbtcontrol to your form as you add a timer.

Example code How to make a connection.

= Wsmbtcontrol1.connect ("127.0.0.1")  502); if (Result ! = wsmbt. result.success)  MessageBox.Show (wsmbtcontrol1.getlasterrorstring ());

Example code to read holding registers.

Int16[] Registers =Newint16[Ten]; Wsmbt. result result; Result= Wsmbtcontrol1.readholdingregisters (1,0,Ten, registers);if(Result! =WSMBT. result.success) MessageBox.Show (wsmbtcontrol1.getlasterrorstring ());BOOLVaild = Mbsserial.licensekey ("661366411818111882382891650b3"); if(!vaild) {MessageBox.Show ("you are not registered successfully! "); } int16[] Registers=Newint16[ -]; Wsmbs.            result result; Result=Mbsserial.open (); if(Result! =Wsmbs. result.success) {return; } Result= Mbsserial.readholdingregisters (2,2, -, registers); //            byte[] x = Parsehex ("0x4481");            MessageBox.Show (X.length.tostring ()); //MessageBox.Show (Mbsserial.registerstofloat (0x4841, 0x0000).           ToString ()); //MessageBox.Show (result.tostring () + registers. Length.tostring ());Mbsserial.close ();

WSMBT Modbus & wsmbs Modbus control and registration machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.