Question about Compilers & Programming Tools

2 Answers

About guidence in this project we are sending command to serial port i.e light1 on,light off ,etc from pc like click on button -> string goes to serial port ( mscomm1.output =*111# ) which makes (room1-device 0ne- on) this goes smoothly here in next part we want to acess from directly switch means after make switch on -> string comes on serial port-> and make caption of button on-> and shows status on vb form for that here we use (mscomm1.input =*111# ) f(or making room1-device 0ne- on) ie after making (room1-device 0ne - switch on) ->sting *111# should comes on serial ports then we chek this input with mscomm.input we define one var in which we store this srial port input .then compare with string and make caption on of command button Private Sub MSComm1_OnComm() Select Case MSComm1.CommEvent Case comEvReceive Dim buff As Variant buff = MSComm1.Input End Sub Private Sub Command1_Click() MSComm1.PortOpen = True MSComm1.Output = "*111#" If buff = "*111#" Then Command1.Caption = "on" MSComm1.PortOpen = False End Sub

Posted by on

2 Answers

  • Level 1:

    An expert who has achieved level 1.

    Problem Solver:

    An expert who has answered 5 questions.

  • Contributor
  • 1 Answer

I still not solved the problem

Posted on Apr 21, 2008

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 1 Answer

Rrrrr

Posted on Apr 28, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How to disable command button in visual basic


  • tep 1 Open Visual Basic and select "Standard Exe" to create a new project.
  • Step 2 Add a button by clicking the square button tool on the right, and then clicking and dragging in the main window.
  • Step 3 Click the button once to open the "Properties" window on the right. Select the "(Name)" property, and type "myCmdButton" as the name.
  • Step 4 Double-click the button to open up the code-view window. Type the following in the white space under "Private Sub myCmdButton_Click()":
    myCmdButton.enabled = False;
  • Step 5 Click the blue "Run" button on the top toolbar of Visual Basic. Because you set enabled to "false" in the previous step, you will see your button grayed out, and nothing will happen when you click it.
  • Jul 07, 2010 | Microsoft Compilers & Programming Tools

    1 Answer

    My computer does not have a 9 point serial port so i had to use a usb adapter instead. I can't communicate to the plc though. any suggestions?


    The 9 pin serial port, dosen;t always have all the "lines" that are in the 15 pin. (obviously) normally ya need Tx, RX RTS, CTS. You need to find out exactly what lines are needed. Make sure via metering that they are all there. Also it may need to cross-over ie: Tx goes to Rx and Rx goes to Tx. Try using a Null Modem. OR try a USB to 9 pin Din serial adapter.

    Jan 25, 2010 | Compilers & Programming Tools

    1 Answer

    Can you make an internet browser with microsoft visual basic 2008?


    yes you can below you have one option:
    Create a new project, and then go to "Project" on the menu.
    Click components as shown in the following image.
    Find the component "Microsoft Internet Controls," check it, and click "Apply" and then "Close."
    Click the icon that was just added in the tools window, and draw a large sized window with it. This is going to be where you view webpages through your browser, so don't make it small, but leave room for buttons and other accessories.
    Make a textbox, this will be your URL bar where you type in the address of the website you want to see.
    Make four command buttons, these are going to be your Go, Back, Forward, and Refresh buttons, change the captions accordingly, and name each of them Cmdgo, Cmdback, CmdForward, and CmdRefresh.
    Now, here's the coding part. This is all it takes to make your webbrowser working:
    Private Sub cmdback_Click()
    WebBrowser1.GoBack
    End Sub
    Makes the back button go backwards, pretty much self explanatory:
    Private Sub Cmdforward_Click()
    WebBrowser1.GoForward
    End Sub
    Same concept, except this time the webbrowser goes forward:
    Private Sub cmdgo_Click()
    WebBrowser1.Navigate (Text1.Text)
    End Sub
    Makes your webbrowser go to the URL in your text box:
    Private Sub cmdrefresh_Click()
    WebBrowser1.Refresh
    End Sub
    Makes your web browser refresh:
    Private Sub Form_Load()
    WebBrowser1.Navigate ("http://yahoo.com")
    End Sub
    The URL shows your homepage, change it to http://google.com or whatever your usual homepage you would like to be.
    Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
    Text1.Text = (WebBrowser1.LocationURL)
    Form1.Caption = (WebBrowser1.LocationName)
    End Sub

    Jan 15, 2010 | Compilers & Programming Tools

    1 Answer

    Problems with VB6 Make .EXE command:


    I guess your compiling logs are absent, or have been corrupted, which are only used to when you publish/make an executable.

    To Confirm this, Make your EXE through Command Line Compiler, and How See this

    If its still not working and your Project is important, then make a blank project and copy paste all Source and Objects there.

    Regards,
    Waqar.

    Aug 18, 2009 | Microsoft Compilers & Programming Tools

    1 Answer

    Example sorurce code for database


    Hello my friend try this code: This code is design for Visual Basic 6.0
    Function for Connection and recordset string.  '========Connection String====== Public Sub connection(ByRef dConnection As ADODB.connection, ByVal dLocation As String)     dConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dLocation & ";Persist Security Info=False;" End Sub '======End of Connection String======
    '=======Recordset String=========== Public Sub recordset(ByRef sRecordset As ADODB.recordset, ByRef sConnection As ADODB.connection, ByVal sSQl As String) With sRecordset .CursorLocation = adUseClient .Open sSQl, sConnection, adOpenKeyset, adLockOptimistic End With End Sub '======End Recordset String========
    How to apply the above function? Application:
    '====== Command Save Button======== Private Sub cmdsave_Click() Dim cn3 As New ADODB.connection Dim rs3 As New ADODB.recordset
    Call connection(cn3, App.Path & "\CASGC.mdb") Call recordset(rs3, cn3, "Select * from Debtor_Creditor_Account") Set dtglobal.DataSource = rs3.DataSource   
    With rs3   .AddNew   .Fields("Code") = txtCode.Text   .Fields("Description") = txtDescription.Text   .Fields("Tag") = cbotag.Text   .Update   .Requery    End With   MsgBox "New Account has been Added", vbInformation   Set cn3 = Nothing Set rs3 = Nothing
    End Sub '=======end of Command Save button=====
    The advantage of using this code is setting your database connection is you have a reliable connection towards your database where ever you place your database you can you don't to remount you databse connection control. Also you are no longer need to use a ADO control or DAO control just copy the function and paste it in your coding area and call the function and you have now a working database and recordset connection string. 

    For more details regarding how to apply this code just email me at this address: geo_jonas@yahoo.com to get more codes. thanks.. Please rate this Solution.

    Jul 08, 2009 | Microsoft Visual Basic 6.0 for PC

    1 Answer

    How to access data from ms access with buffer in class code with vb application


    Use ADO and create a connection string for a Jet file (version matters here when creating the string). Then use ADO commands and return recordsets to buffer your data.

    Mar 26, 2009 | Microsoft Visual Basic 6.0 for PC

    1 Answer

    Table creation via textfields using swings


    import java.lang.Object;
    import javax.swing.table.DefaultTableModel;


    public class tabletest extends javax.swing.JFrame {
    String[][] row = null;
    String[] title=new String[3];
    private int i;


    /** Creates new form tabletest */
    public tabletest() {
    initComponents();
    setTitle("table test");
    setVisible(true);
    System.out.print("NO Database Needed");
    title[0]="Name";
    title[1]="Desig";
    title[2]="id";
    }


    /*
    " In middle of this two source one generated code will be there that will be done by dragging ur fields to ur frame. THIS IS FOR netbeans IDE "
    */

    private void b1ActionPerformed(java.awt.event.ActionEvent evt) {
    row=new String[4][3];
    // TODO add your handling code here:

    String s1=t1.getText();
    System.out.println(" event 1");
    String s2=t2.getText();
    System.out.println(" event 2");
    int k=Integer.parseInt(t3.getText());
    String s3=""+k;
    System.out.println(" event 3");
    try{
    // for(int i=0;i<=2;i++)
    row[i][0]=s1;
    row[i][1]=s2;
    row[i][2]=s3;
    i++;

    }catch(Exception e){
    e.printStackTrace();

    }
    table.setModel(new DefaultTableModel(row,title));
    }

    private void b2ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:

    t1.setText("");
    t2.setText("");
    t3.setText("");

    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new tabletest().setVisible(true);
    }
    });
    }

    // Variables declaration - do not modify
    private javax.swing.JButton b1;
    private javax.swing.JButton b2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel l1;
    private javax.swing.JLabel l2;
    private javax.swing.JLabel l3;
    private javax.swing.JPanel p2;
    private javax.swing.JScrollPane scp1;
    private javax.swing.JTextField t1;
    private javax.swing.JTextField t2;
    private javax.swing.JTextField t3;
    private javax.swing.JTable table;
    // End of variables declaration

    }

    Mar 13, 2009 | Compilers & Programming Tools

    1 Answer

    Sorting string and numeric


    One simple way to achieve this is using radio button function. Give the user flexibility to change sorting via String or Numeric. As the user clicks on String the result bottom of this option will change the sorting method using String. Otherwise, Numeric.

    By the way, please be specific in posting your question. Include the development tools that you use. For example, MS Access 2003.

    Regards,
    Maha

    Feb 04, 2009 | Intelligent Computer Compilers &...

    2 Answers

    Visual basic 6.0


    Use a compare (instr) command to search the sentence for punctution and spaces. Increment a variable for each word found, resetting the search string and retaining the start position of each find.

    Feb 27, 2008 | Compilers & Programming Tools

    2 Answers

    Java/j2ee source code


    See this web site it will help for you

    http://www.academictutorials.com/

    Feb 25, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

    Not finding what you are looking for?
    Compilers & Programming Tools Logo

    Related Topics:

    52 people viewed this question

    Ask a Question

    Usually answered in minutes!

    Top Compilers & Programming Tools Experts

    Robin Hill
    Robin Hill

    Level 3 Expert

    1251 Answers

    Fred Block
    Fred Block

    Level 2 Expert

    289 Answers

    Les Dickinson
    Les Dickinson

    Level 3 Expert

    18299 Answers

    Are you a Compiler and Programming Tool Expert? Answer questions, earn points and help others

    Answer questions

    Manuals & User Guides

    Loading...