Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

visual basic help!!!!!!!!

Options
  • 27-02-2006 6:50pm
    #1
    Closed Accounts Posts: 18


    :confused: hi guys
    i had to join this forum today coz i am really in need of help, myself and another girl were given a project to do on PLC'S, I need to design a visual basic screen that programs the PLC and then outputs the program onto a PIC development board.

    So on my screen will be different PLC instructions on but my main problem is to get all these compiled instructions together somehow in order to send them to the board.

    11 12 13 14 15 16 output
    21 22 23 24 25 26 output
    31 32 33 34 35 36 output
    41 42 43 44 45 46 output
    51 52 53 54 55 56 output
    61 62 63 64 65 66 output

    i have researched this quite abit and thought that mayb a matrix like above will work but how will the visual basic see this and how should i compile it together to be sent.

    Any help will be greatly appreciated

    suz


Comments

  • Closed Accounts Posts: 51 ✭✭david powell


    Hi,

    Just had a quick read of your post, and I'm not sure what your trying to do....:confused:

    I have good experience with PIC microcontorllers / VB / serial communications and some PLC experience, but can't figure out what your goal is....

    Are you trying to get a PLC to program a PIC micro-controller??

    Drop me some more info, i might be able to help..... :)


  • Closed Accounts Posts: 18 suzie06


    Hi dave
    form.jpg
    here is my screenshot, yea i need to progam the PIC using this PLC screen, the pic is 16f877 hope this helps

    cheers

    szlonergan@yahoo.ie


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    If your going to give a solution can you keep it in the thread.


  • Closed Accounts Posts: 51 ✭✭david powell


    Hi,

    I now see what your trying to achieve…. I’ve seen a few of these PLC -> PIC compilers before… As this is a learning project, you’ll understand if I don’t give all the answers, but I have no problems giving a few pointers in the right direction.

    I assume your familiar with PIC16 assembly language, eg BTFSC, BTFSS ect…. ??? You will need to be quite familiar with this, as you will be attempting to generate this code automatically based on the ladder logic entered into the VB GUI.


    What I would see as logical is:- :rolleyes:

    1) When you hit “Compile” in your VB program, it generates an assembly language file ( ASM file ). This ASM file should contain all the instructions required to implement the desired logic on the 16F877. It should also set the appropriate port directions ect…

    2) Then you invoke an assembler, to assemble the ASM file ( generated by your VB program ) into a Hex file. You can use MPASMWIN.exe from microchip for this. Initially I would use MPASMWIN.exe manually, but you could “invoke” it automatically from VB latter on. MPASMWIN.exe will generate a hex file for the target

    3) The Hex file can then be programmed the target device using a general purpose PIC programmer, eg pic-start, promate II ect..

    4) The target device should now implement the ladder logic


    Notes:- I would first test the ASM/HEX files on MPLAB simulator before ever going near the target device in #3. This simulator is quite handy

    Notes:- Don’t want to lecture you, but It’s best if you can clearly describe the task/project step by step in plain ordinary plain English. As if this is a college project an external examiner might not be too familiar with the concept of your project and may require a brief explanation, like the steps i've outlied above :)


  • Closed Accounts Posts: 18 suzie06


    I perhaps should have pointed out that i am using c programming to program the PIC on my development board, but i think i kinda understand your pointers thanks


  • Advertisement
Advertisement