Can Visual Basic be used to control a piece of mechanical equipment?

35 pts.
Tags:
PLC
Visual Basic
Windows Product Activation
Before I spend a lot of time learning VB (I am an old Basic man) I want to know if it can control a process, the way a PLC does.

Or should I be looking at another device or language. I can use a plc, but I'd rather use a Windows based processer. PLCs are too darn specific. Each one has its own language, even within brands at times. I'm sick of recreating programs for PLCs.

 

Jim 



Software/Hardware used:
WIndows VB

Answer Wiki

Thanks. We'll let you know when a new response is added.

It can as long as there is a way to talk to the equipment. Either a published API or a network or serial connection you can talk via.

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • GTPJim
    Thanks for your response! So you are saying that VB bas the facility to allow free running programs, without keyboard input constantly? Thanx again
    35 pointsBadges:
    report
  • Chippy088
    Are you trying to program the PLC, or are you trying to simulate it on a PC? Most visual languages will compile before running, so tight code could be created, if you have the skills needed. You will need to understand the I/O ports on the PC, much in the same way for the PLC. Then you set the program to monitor them and react accordingly. The last time I had anything to do with PLCs was at college, where we used an Acorn BBC B computer basic, which compiled before running. That was in 1980, so I may be way out of date. Good luck, and let us know how you get on please.
    4,625 pointsBadges:
    report
  • Dbaechtel
    I have used VB in industrial automation for more than 20 years. One thing you will need is a Kernel device driver or the equivalent to talk to the hardware. You can use the PC serial port or parallel ports if you have them as I/O points. You can talk to I/O like Opto-22 this way. You can also use USB or Ethernet to communicate with I/O devices. In VB you can use the Sleep function to get a routine to repeat at a fairly regular intervals so that you can do PLC and PID like functionality. VB programs do not require keyboard or Windows Inputs in order to function. In VB you can have some threads that do GUI functions and other threads that do automation at regular intervals and the threads can exchange data amoungst themselves to accomplish the desired functionality.
    30 pointsBadges:
    report
  • GTPJim
    We have used PLCs for years, and I would like to program for a PC instead. My primary complaint is the programming for one PLC can't be moved to another, often even within brands. I just thought if I could use a windows based control, then we would not have to spend time changing programs. Also, updating a program for a PLC can be a real treat, you change one variable or screen and every other label has to be updated.... Jim
    35 pointsBadges:
    report
  • GTPJim
    Dbaechtel Thanks, I thought there had to be a way. Being as I have little knowledge of what you speak of, I assume this will take a bit of time to learn. I'm smart, but not a machine. I used to be pretty good at Basic programming, but it has been a while. Can you recommend where or what the needed items/software are? I could pay "consulting fees", everyone has to make a buck. Jim I have used VB in industrial automation for more than 20 years. One thing you will need is a Kernel device driver or the equivalent to talk to the hardware. You can use the PC serial port or parallel ports if you have them as I/O points. You can talk to I/O like Opto-22 this way. You can also use USB or Ethernet to communicate with I/O devices. In VB you can use the Sleep function to get a routine to repeat at a fairly regular intervals so that you can do PLC and PID like functionality. VB programs do not require keyboard or Windows Inputs in order to function. In VB you can have some threads that do GUI functions and other threads that do automation at regular intervals and the threads can exchange data amoungst themselves to accomplish the desired functionality.
    35 pointsBadges:
    report
  • Dbaechtel
    Try something like the following. You need to fill in the 'code lines with hardware specific code.
    Imports System
    Imports System.Threading
    Module Module1
        Public Class Automation
            Public Sub New()
            End Sub
            Function ReadInputs() As Boolean()
                Dim inputs(64) As Boolean
                'code to Read Inputs
                Return inputs
            End Function
            Sub WriteOutputs(ByVal outputs() As Boolean)
                'code to Write Outputs
            End Sub
            Function DoLogic(ByVal inputs() As Boolean) As Boolean()
                Dim outputs(64) As Boolean
                'code to Generate outputs from inputs
                Return outputs
            End Function
            Sub DoWork()
                While 1 'forever
                    Thread.Sleep(5) 'execute every 5 milliseconds or so
                    Dim inputs(64) As Boolean
                    Dim outputs(64) As Boolean
                    inputs = ReadInputs()
                    outputs = DoLogic(inputs)
                    WriteOutputs(outputs)
                End While
            End Sub
        End Class
        Sub Main()
            Dim myAutomation As New Automation
            Dim newThread As New Thread(AddressOf myAutomation.DoWork)
            newThread.Start()
        End Sub
    End Module
    
    30 pointsBadges:
    report
  • Dbaechtel
    I have 30+ years of creating industrial automation using many languages including VB. I would be glad to speak with you more about the details. You can reach me at dbaechtel@gmail.com. Please send me you contact information.
    30 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following