Visual basic 6.0 with PCI-CAN series 2

Hi all,
I'm a newbie in CANOPEN, hopefully I can get some guidance to start off the application development.
Basically I wished to develope a simple VB program to move/stop the motor at different speed and to monitor the position.
There is only 1 master which is the PCI NI-CAN and 1 device. The device which is the servo amplifier is Kollmorgen S600.
http://www.maccon.de/fileadmin/FTPROOT/s400600can_e.pdf
During the amplifier boot up, I'm able to receive 0x81h 00 00 00 00 00 00 00 00 at both the MAX's bus monitor and the NI's Frame API, thus ensuring that the baud and hardwares are correct.
I wished to perform a "SDO-READ" and "SDO-WRITE" using the Frame API as followed :
http://img.photobucket.com/albums/v208/rainman1978/sdoexample.jpg
The Frame API VB software example given has this abiturary ID, data length, remote frame (YES/NO) and extended frame (YES/NO). In the write procedure it has :
Transmit.Data(0)=&H0
Transmit.Data(1)=&H1
Transmit.Data(2)=&H2
Transmit.Data(3)=&H3
Transmit.Data(4)=&H4
Transmit.Data(5)=&H5
Transmit.Data(6)=&H6
Transmit.Data(7)=&H7
etc etc followed by its standard ncwrite procedure.
I made change to the transmit datas.
Transmit.Data(0)=&H40
Transmit.Data(1)=&H41
Transmit.Data(2)=&H60
Transmit.Data(3)=&H0
Transmit.Data(4)=&H40
Transmit.Data(5)=&H0
Transmit.Data(6)=&H0
Transmit.Data(7)=&H0
There isn't any response back from  the amplifier and I bet the frame format must be wrong.
This is what I observed from the NI SPY when I send out the data. (when VB set to ID 5 and data length set as 8)
05 00 00 00 00 08 00 00 41 60 00 40 00 00 00 (something likethis, which I couldn't relate at all)
Thanks. Hope I can get a wake up call to this complicated bus protocol.
Regards,
Rainman
Attachments:
Transmit Receive same Port.zip ‏5 KB

Got it!!!
To all that will try to use the VB6 application:
In the LabView examples the COB ID default is in hex, and in the VB examples the COB ID default is dec !!! The GUI of the 2 examples (VB & LabView) is exactly the same but it will not work unless you use the correct COB-ID.
So, for example, if you want to use the labview example and you want to enter the ID 601: you Enter 601 in the ID text box.
However, if you want to use the VB6 example with the same ID you need to insert 1537 (=601 hex!!)
I hope that with this post I will save some people the 3 days that it took me to find this!
Shilo

Similar Messages

  • Visual Basic making pdf with hyperlink Acrobat 9 / Office 2003

    hello,
    I try to make document with VBA and I can't use the same references.
    AdobePdfMakerForOffice seems don't work since Acrobat 6 ( an object seems to have disappear)
    I have try with pdfmakerapilib an have an error (-10)
    If someone has an Idea for that operation ... It should be helpfull.
    thanks,
    BonandKlyd

    Thanks!!! It is version 9.3.1. Should I upgrade for better?
    But WHen I tried again changing the parameters as below: trying to print a few pages
    l_oCAcroPDDocPrint.PrintPagesSilent(0, 2, 0, 0, 0) - 0 first page and 2 last page. It works fine.
    In 7.0 I used -1 in place of last page and it printed all pages of that particular PDF.
    I did not find about printing all of these pages from Acrobat 9.0 API. Can you please let me know?

  • How can a Visual Basic Application be used to read a Netscape LDAP server?

    I would Like to know if Visual Basic (ON AN NT WORKSTATION) can be used to access a Netscape LDAP Server (ON UNIX). And If so, will any API calls be necessary? Is there any documentation on using Visual Basic with LDAP?

    Hi Ryan,
    yes you can use VB with the nsldap32v30.dll or nsldap32v30.dll. You can get this from the iplanet page . The dll is inside the LDAP C SDK. Then, there's a 3 or 4 year old vb sdk with the declarations of the LDAP functions; but this seems not to be available in the web.
    Please send me a mail, I'll send you the doc and a sample vb prog.
    remove the nospam.
    [email protected]

  • Canopen through visual basic

    Hi i am new i in working with canopen,i am in compulsion to acquire canopen based encoder through visual basic 6 than labview,can anyone suggest the configuration which i need to make in visual basic for the same....
        the hardware wich i have to acquire is pci can series 2
    if someone can sendsome example to acquire the canopen datas through visual basic it will be very helpful &....
    i am eagerly waiting for  all ur reply

    Hi,
    I could not find any examples for VB and CANopen. You could try to program it by using the Frame api;  a fairly good knowledge of NI CAN and CANopen would be needed to do this.  I know you said you wanted to use VB, however NI does have a CANOpen LabVIEW Library which will work with all High Speed Series 2 cards.  The library does not have support for other languages however, so it will not work with VB 6. 
    Regards,
    Adam W
    Applications Engineering
    National Instruments

  • Using Crystal Reports in Visual Basic 2010

    I am trying to add several Crystal Reports to a new project and having a major problem.  Here's the situation. I created a new Visual Basic 2010 project with only one form, In visual Basic I added Crystal Reports.   I then imported a form that was created in Crystal Reports 8.5.
    There were no errors and the report with valid data was visible. I then tried to run...it wouldn't run and 31 errors appeared.
    Obviously I missed something. I have searched for a very simple basic tutorial and  either can't find one or didn't recognize one.
    Can anyone point me in the right direction.
    Milt

    Ok. So, you added the report to the project. Now we have to add the CR assemblies to the project, add the viewer (if need be) and fire it off. Simplest code would be:
    Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            CrystalReportViewer1.ReportSource = ("path to report")
        End Sub
    In this case you are using the viewer SDK to runt he report. The report will prompt for any logon parameters - but you can code these also. You can load the report via the engine as bellow. Again, the report will prompt. I prefer to use the engine as it is way more "extensible"...
    Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
            crReportDocument.Load("path to report")
            'Bind the report to the viewer
            CrystalReportViewer1.ReportSource = crReportDocument
        End Sub
    If you have a report added to the project (strongly typed) the code would be:
    CrystalReportViewer1.ReportSource = New myReport()
    For more details, I'd recommend looking at the sample app vbnet_win_simplepreviewreport.zip available from the following location:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    The developer help files are here:
    [SAP Crystal Reports .NET SDK Developer Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip]
    [SAP Crystal Reports .NET API Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip]
    - Ludek

  • Stored Procedure w/ binary data parameter problems in Visual Basic

    Howdy all.
    I am having a problem calling stored procedures with a BLOB parameter. I have tried changing the paramater other data types to see if it would work, but with no success. I am calling the stored procedure from Visual Basic using ADO. I am using the Oracle ODBC Driver, Release 9.2.0.4.0. I have tried changing the setup of the ODBC a good bit because that has fixed several problems for me in the past; however, it did not fix my current problem.
    Here is what I am trying to do. I have a function like the folowing:
    <BEGIN --------------------------------------->
    CREATE OR REPLACE FUNCTION PAGEFORMATSINSERT(
    p_ObjectFormatCode_ID      IN RAW DEFAULT NULL,
    p_PA_ID      IN RAW DEFAULT NULL,
    p_Name      IN VARCHAR2 DEFAULT NULL,
    p_FormatData      IN BLOB DEFAULT NULL,
    p_PF_ID      IN OUT RAW )
    RETURN INTEGER
    AS
    BEGIN
    INSERT INTO PAGEFORMATS (PF_ID, ObjectFormatCode_ID, PA_ID, Name, FormatData) /* <---- this FormatData column is a BLOB column */
    VALUES     (p_PF_ID, p_ObjectFormatCode_ID, p_PA_ID, p_Name, p_FormatData)
    END PAGEFORMATSINSERT;
    <END ----------------------------------------->
    The FormatData parameter has a data type of BLOB. In my Visual Basic, I have my ADODB.Command object. I am setting the CommandText of the Command object to "{? = call PageFormatsInsert(?, ?, ?, ?, ?)}". In order to set the parameter value for the BLOB data type, I am calling the AppendChunk function of the Command object - passing it a Byte array.
    I am getting the folling error:
         ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06550: line 1, column 13:
         PLS-00306: wrong number or types of arguments in call to 'PAGEFORMATSINSERT'
         ORA-06550: line 1, column 7:
         PL/SQL: Statement ignored
    If I change the FormatData parameter to a LONG RAW parameter, I get the following error:
         ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error
         ORA-06512: at line 1
    I am at a loss as to how to get binary data into by Oracle database. I need to do it using stored procedures. How can I set up my stored procedure or table to do what I want it to do? Should I change my table definition? Are there some settings in the ODBC connection I can tweak? How can I get the stored procedure to accept my call from VB ADO?
    Any help would be appreciated.
    wally

    Thanks for the idea, but I don't get how I am supposed to get my binary data to the stored procedure using the stream. I have a binary array that I want to pass to a stored procedure. I want to be able to use the same Visual Basic front end with out MSSQL database as with our Oracle database.
    I am using the ADODB Connection and Command and RecordSet objects. Currenlty our front end calls the ADODB.Command(ParamNumber).AppendChunk function passing it the binary array. Somehow, the SQL Server driver does the magic in order for the MSSQL stored procedure to work correctly. I need to know how to do one of the following:
    1. Get the Oracle driver to do the same magic.
    2. Set up the Oracle stored procedure so I don't have to change the VB front end.
    3. Change the VB front end so that it works with both MSSQL and Oracle.
    wally

  • URGENT HELP :WEBSERVICES - VISUAL BASIC/POWERBUILDER

    CAN AN APPLICATION BUILT USING VISUAL BASIC(APP A) OR POWER BUILDER(APP B) MAKE A WEBSERVICE CALL TO A JAVA APPLICATION.THE REQUIREMENT IS..APP A & APP B SHOULD TALK TO A JAVA BASED APPLICATION BY PASSING INPUTS AND THE JAVA APP PROCESSES THE INPUTS AND SENDS BACK THE OUTPUT TO APP A & APP B.
    IS THIS POSSIBLE USING JAVA WEBSERVICES? IF YES..HOW? ELSE ANY WAY OUTS?
    -IK

    IK,
    A new XML/JAVA adapter for Visual Basic and PowerBuilder (named ActiveEC) can accomplish the integration scenario you describe. From the product site:
    "With no PB or VB code changes or migration, ActiveEC instantly creates XML ?black boxes? for existing PowerBuilder and Visual Basic applications, enabling them to communicate with portals, Web services, business process compositions and other applications. All PB/VB application security and integrity is maintained, and the existing applications can continue to be used through the native PB/VB interfaces. The unique part of the technology is that it requires no changes to the underlying application code, so it can be used easily and safely with "legacy" client/server apps. This technology instantly discovers all application and screen controls to deploy reliable, complete Web services. Once you deploy an ActiveEC service, you can invoke this service through the following standard interfaces: Web service, EJB, JMS, .NET assembly"
    http://www.active-endpoints.com/products/activeec/index.html
    HTH,
    A.J.

  • Microsoft Word hung on No Visual Basic in application message

    Hi All
    I'm desperately trying to writ ean assignment due in a week but Microsoft Word has frozen on an academic journal which I downloaded from an academic database. A message box appears telling me that there is no Visual Basics in Application. I can't open any .doc because this message box won't go away. I;ve tried Force Quit but when I open up Word again, the same journal appears followed by this warning message. Please help!

    Thank you for the advice. The site did not entirely provide clear solution but I got the gist. I had installed EndNote through the university and somehow, there was something there called EndNote CWYW bundle sitting in the Word Folder that resided in the Start Up folder of Microsoft Office. I pulled the EndNote folder out onto the desktop and now Word is functioning normally.
    Thanks very much for directing me to a place where I could begin to work out a solution. Cheers. You're a real gem.

  • How can i write a pattern to a output port of NI PCI 6503 with Traditional NI DAQ 7.0 and Visual Basic 6.0?

    Hello, i'm using a NI PCI-6503 (with CB50LP accesory) to write digital patterns to one of the output ports. Can i do it directly from NIDAQ7.0?
    I know  some Visual Basic 6.0 functions to configure a par as output and to write a pattern to a port, but i don't know how run it.
    I've read some examples from "Help" (C:\Program Files\National Instruments\NI-DAQ\Examples\VBasic\Do) but I can't measuring TTL levels on my CB50LP accesory.
                    Thanks!!

    Hello,
    What is your buffer size ? The buffer should be 0 or greater than 2. You can get this error if your buffer size is equal to 1.
    Regards,
    Isabelle
    National Instruments France
    Isabelle
    Ingénieur d'applications
    National Instruments France

  • Can you tell me how to measure audio signal frequency in measurement studio with visual basic 6.0?

    I'd like to measure two differential input signal(I.e. A+ and A-),below is two test projects,
    1.connect A+/A- to PCI 6052E card's ACH0/ACH8 ,and refer to GND for testing
    2.connect respectively A+/A- to PCI 6052E card's ACH0/ACH8 for testing
    Could you tell me the details of the second project?and give me a illustration in measurement studio with visual basic 6. 0 about the second?
    In addition,I would like to measure the audio signal frequency,could you give me a illustration in measurement studio with visual basic 6.0?
    Wait for your reply!

    Dear kelven,
    Thank you for contacting National Instruments.
    To address your question, there are Analog Input shipping examples that demonstrate how to measure an analog input differentially, as you specify in (2).
    As for measuring the audio signal frequency, you may want to check out the following KnowledgeBase. The link is:
    http://digital.ni.com/public.nsf/websearch/4b08380530d72d3b86256340004c3005
    Let me know if you have any further questions or if this does not resolve your issue.
    Thanks again and have a great day!
    Chad AE
    Applications Engineer - National Instruments

  • How can i measure the transmision time in gpib with visual basic with more precision if i use time() function?

    I want to take a measurement of the time that i use to make a gpib transmision in a Visual Basic program,i use the function TIME() to take the time in the begining and other time in the end,but this way only give me precision of seconds, and i want miliseconds,can i use other function,other way?
    Can answer in spanish?

    Try using GetTickCount() API function, which provides millisecond precision. If you need more precise timer, try using QueryPerformanceCounter() function.
    Makoto

  • Microsoft Word hangs with message "Can't load Visual Basics in Application".

    When I try to open my Word docs, only 1 document opens and this is swiftly followed by an error message saying "Can't load Visual Basics in Application". Please help as I'm desperate to write an assignment. Many thanks.

    I reinstalled Word, and now everything works. 

  • PCI-GPIB Card with Visual Basic gives blue screen and re-boots PC

    The application makes the "ibsic" call then "ibln" to find devices on the bus. Running the VB program the first time is fine, but if you end the program and re-run a second time, you get a blue screen and the PC reboots when the program reaches the lines that make the first call to the NI-488 functions. If you close out of VB and then restart VB, everything is OK again.
    What is wrong?

    Hi,
    Here's an article that describes the most common blue screen when using VB:
    Why Does My Windows 2000 or XP System Crash When I Use Visual Basic to Program GPIB?
    Hope this helps
    DiegoF

  • Can I have a general daq event in visual basic while outputing in dma mode?

    Hardware: PCI-6711
    Software: Visual Basic 6.0
    NI-DAQ 6.9.3f3
    Windows 2000
    I can't get the GeneralDAQEvent_Fire subroutine to happen. I'm trying to output two synchronized waveforms on two channels at sampling rates that can be changed on the fly. To do this, I've set the clock source of the channels to be the GPCTR1. I output on a pulse train on the GPCTR1 and adjust the pulse widths to vary the frequency. I need to be able to switch to the new pulse width at a precise time so that the correct samples are output at the correct samplerate. I want to generate a general daq event which fires whenever a certain number of pulses (and thus samples) on the GPCTR1 have been output. I will
    then reset the event and output samplerate within the GeneralDAQEvent_Fire subroutine for the next section of samples. I need to output at up to 1 MSample/second, so I need to be using DMA mode. I have not read anywhere that DAQEvent 0 Aqcuired or Generated n Scans requires interrupt mode, am I wrong about this? I have set my Channel string to CTR1, does this reference the GPCTR1? I set the board, DAQTrigVal0 and enabled properties and then call the refresh method. Is there something else I should do?
    I have been reading the NIDAQ Function Reference Help and the NIDAQ for PC Reference manual and have not found a solution. Any suggestions? Also, where can I find info on what the ConfigureDaqEvent method is supposed to do?

    Roz,
    First of all, I think you will want to use DAQ Event 1 since you desire for a message to be sent after every N updates. This will be more efficient than removing the current message and adding a new message each time the event fires. Furthermore, DAQ Events 0-2 can all be used with DMA transfers. However, you will be unable to use a counter channel with DAQ Events 0-2. Instead you should use one of the analog output channel you are clocking with the counter's output.
    Good luck with your application.
    Spencer S.

  • I need help with motion control. I am programming in Visual Basic. I will need help with what parts I need to purchase from NI, along with help on the code.

    I am using a Papst servo motor and I need to know where to start and what to purchase to get this motor to spin. I am using visual basic and in my program I calculate the direction and RPM's needed from the motor. It will spin anywhere from 1 to 10000 RPM's. It seems rather easy, but I have no idea on how to spin the motor at the specific RPM, and stop it with a command stop in the program. Please help.

    We really should know a little more about your intended uses for this system, but assuming you want to do relatively simple (or even not so simple!) motion, you'll need a few components...
    A motion controller, such as the PCI-7342, can take your VB commands and turn them into the commands needed to "run" the motor. Next you'll need a drive, such as the MID-7342. This includes the servo amplifier that actually powers the motor. It also has connections to "pass through" the encoder signals from the motor back to the motion controller.
    The above-named pieces assume one or two axes of motion. You'll also need a cable to connect the two (can't remember the model right now). You can use MAX to configure the motion controller, and there are just a few VB calls you
    'll need to make using NI-Motion functions to define the motion and get it going.
    Hope this helps!

Maybe you are looking for

  • Dynamic column selection

    I want to select specific columns from a table dynamically which are basically the columns returned by quering the user_tab_columns data dictionary which in turn has to satisfy certain condition for me. So, what I want to do is something like: SELECT

  • Upgraded to iOS 5, now my iPad is stuck

    Another issue, one of many...I upgraded to iOS 5, can get past set up, can't get back to settings without going back to factory settings...recevied e-mails and verified all of those...following the prompts I was led to the point of "Find My iPad"...w

  • Lightroom Folders management

    Good day Adobe file structure and Microsoft....... I may end up by having  problems with my files (Folders) with the way I do it now......... Is there a better road? I shoot in RAW (Nikon) and transfer all photos to: A) File: Raw from camera. Photo: 

  • Error In ICSS Application

    Hi Expert,   I am new In ICSS apllication..I have some problem in login page.i am trying to open Icss Application using Url--https://dev1crm.ra.rockwell.com:52001/icss_b2b/init.do. above URL is running perfectly ,suddenly i got error like --" No acti

  • Tips for using an older Hard Drive with an enclosure

    Hello, I have a two-parter in regards to an external hard drive. I want to be able to use an older hard drive off one of my PCs for an external hard drive through an enclosure. Question 1: Before I purchase the enclosure I was wondering if any USB en