Home

User`s Manual for the CV

image

Contents

1. IstMeasurementD ata a tmrTrigger 14 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 5 4 5 4 1 Date August 19 2010 Connecting to the CV 5000 Device In this section we will be adding code to the application the light gray code is code that has already been added to the application either by the windows IDE or in a previous step and is just included to help the user grasp where the code is to be added In this section we will add the code to connect to the CV 5000 device and display the connection status on the screen so the user can see that they are connected This section will also introduce the basic concepts of thread safe programming and handling the events that are raised by the CV 5000 Library The sections that follow will build on these basic concepts to retrieve measurement data and finally an image from the CV 5000 Add CV5000_ Series Namespace amp Create an CV 5000 Library Object Use the mports statement to enable access to the CV 5000 library s namespace Before you add the mports statement you must have previously added a reference to the library as defined in Section 5 2 Now double click on the title of the form to bring up the forms code window and add the following above the forms class definition as shown Imports CV5000_Series Public Class Forml Private Sub Forml_Load ByVal se
2. Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteWindowCalculationValue int windowNumber WindowType windowType string symbol MeasuredValueLimit measuredValueLimit double value DW windowNumber 0 to 127 windowType WindowType enumeration MeasurementWindow or CalculationWindow symbol See page 4 258 in the CV 5002 Series User s Manual measuredValueLimit MeasuredValueLimit enumeration HL or LL value Value to set calculation value to None RUN Writes the window calculation value ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of DW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteWindowCalculationValue 0 WindowType MeasurementWindow X MeasuredValueLimit HL 3 0 _cv5000 WriteWindowCalculationValue 0 WindowType MeasurementWindow X _ MeasuredValueLimit HL 3 0 8
3. On Success C Example VB NET Example public bool CloseConnection None Boolean True Connection Closed False Error closing connection ALL Closes connections to data and image ports Sends signals to background threads to exit ErrorOccurred event triggered N A If connections successfully closed the OnConnectionClosed event will be triggered cv5000 CloseConnection _cv5000 CloseConnection 36 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 3 3 Method SendRawCommand Method Signatures public void SendRawCommand string cmd public void SendRawCommand siring cmd byte bytes Parameters cmd Command in string format to send to CV 5000 series device bytes Array of bytes to send to the CV 5000 Series device directly after cmd Return Type None CV Modes ALL Description This method will send a command to the CV 5000 series device For a pure ASCII command use the version of the function with just a cmd parameter For a command that sends binary data use the version with 2 parameters Send the ASCII part of the command including the final comma in the cmd parameter Then send the bytes to be sent in the bytes parameter The SendRawCommand function will calculate the checksum and append it to the end of the byte array Method Error ErrorOccurred event triggered CV Erro
4. Trigger input enabling TE TriggerlnputEnable TriggerlnputDisable Communication enabling LK EnableCommunicationsPort DisableCommunicationsPort Password PS ChangePassword Remote control console pseudo KY RemoteControlPseudolnput input Echoing EC EchoText Reading statistics data ST SaveStatisticalData 39 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC 6 4 1 Method Trigger Method Signature Base CV Commands Parameters Return Type CV Modes Description Method Error CV Error On Success Date August 19 2010 public void Trigger int number T1 or T2 number Trigger number 1 or 2 None RUN Performs a trigger ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of T1 or T2 The error that the device returned will be in the ErrorCode property of the DataEventArgs object At least one DataReceived event will be fired for the data received over the CVDataPort A second DataReceived event may be fired for data received over the CVImagePort depending on how the CV device is configured If no measurement data is received then the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode
5. Added Deployment Section 2009 11 25 Added information on installing activation tool on client computer Add note for user to copy CQActivation dll to application directory Run setup exe instead of CV5000LibSetup msi 2010 08 19 Updated activation section so that development distribution option is no longer shown Added section on using the CV 5000 Library with 64 bit operating Systems Added to TriggeredimageCameraNumber TriggeredimageTotalStatus and TriggeredimageMeasurementCount properties to DataEventArgs Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 TABLE OF CONTENTS SECTION TITLE PAGE 1 End User License Agreement for Conquest Consulting CV 5000 Series NET Library 1 PV OTAC Oar EEE eset ANE ves Uancceatend yess ETEA N 4 3 Overview of the CV 5000 NET Library ss1cccseccccseeeseceessnencesneecsseenssennssnaanessennseeesssnaneasnansesenssnsanenenes 5 3 1 Minimum System Requirements 1 c sccccccccccsseccenceeceneeesnaecseneecsneeessaesseaeecssensesansssseecseneesenntesaees 5 ii Getting Started EATE T cies ot Sa ec Sacto ea ty calves Shes oe Seadatys T 6 4 1 Installing the CV 5000 NET Library 2 2 ccccccsccceesceescesscesnsceeneesaeecaceceaecaaecaeceasceeseenssenseensseensnenes 6 4 2 Progr m MONU eriin clebiaya woseee cendavves ctedivigdedlevysusd iaaea Aa Tiaa
6. CommandCode SW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteLibraryDataToCurrentProgram 0 data _cv5000 WriteLibraryDataToCurrentProgram 0 data 69 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 29 Method ReadProgramDataFromSDDevice Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadProgramDataFromSDDevice int programNumber SDOptions sdOption SR DT programNumber 0 to 999 sdOption SDOption enumeration SDCard1 or SDCard2 None RUN Retrieves program data from a SD Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of SR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SR BinaryData Property Byte array containing program data RecMode P
7. T1 or T2 depending on which trigger was triggered RecMode Property RecTrigNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration If measurement data is received then the following properties will be set in the instance of DataEventArgs received over the CVDataPort ResultData String containing result data from the trigger See CV 5002 Series manual to interpret the data CommandCode T1 or T2 depending on which trigger was triggered RecMode Property TrigResultData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration If image data is received as a result of the trigger the image data will be received on the CVimagePort The DataEventArgs will contain the following values Bitmap Property Bitmap of Image BinaryData Byte array containing bitmap bytes CommandCode T1 or T2 depending on which trigger was triggered RecMode Property TrigimageData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error 40 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this docume
8. individual files with a bin extension This option tremendously degrades the performance of the CV 5000 and should only be enabled when troubleshooting This option also uses a lot of disk space because the binary transmissions are logged as well Be sure this option is set to False before distributing your application Debug mode logs can be found in the following directory XP C Documents and _ Settings Conquest Local Settings Application Data Keyence_CV Vista C Users UserName AppData Local Keyence_CV This option is turned off by default 6 1 7 Property ErrorLogging Type Boolean This property can be set to True to assist developers in diagnosing errors with the CV 5000 series device When enabled the CV 5000 NET Library will log all errors that occur to an ASCII log file given the name date err where date is the current date Error mode logs can be found in the following directory XP C Documents and _ Settings Conquest Local Settings Application Data Keyence_CV Vista C Users UserName AppData Local Keyence_CV This option is turned on by default 6 1 8 Property BinaryDump Type Boolean This property can be set to True to assist developers in diagnosing errors with the CV 5000 series device When enabled the CV 5000 NET Library will all data that comes in from the CV Device and save it to a series of files This option can use a large amount of disk space BinaryDump logs for each day will have their own directory name based on th
9. instance of DataEventArgs received over the CVDataPort CommandCode SW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteProgramDataToSDDevice programData _cv5000 WriteProgramDataToSDDevice programData 64 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 24 Method WriteProgramDataToCurrentProgram Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteProgramDataT oCurrentProgram byte programData SW DT CP programData Array of bytes None RUN Writes program data to the current program ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of SW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SW RecMode Property CmdResponseNoData CVReceiveMode enumeration Er
10. will be triggered with a CommandCode of ER and a CommandCode 2 of EC The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode EC ResultData Echoed text RecMode Property Echo CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 EchoText test _cv5000 EchoText test 102 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 62 Method SaveStatisticalData Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SaveStatisticalData string folderName ST folderName Folder on SD Card 2 to save statistical data to None RUN Saves statistical data to SD card 2 ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of ST The error that the device returned will be in the ErrorCode property of t
11. 4 CV Commands The following table shows the commands available in the CV 5000 Series and the applicable commands in the CV 5000 NET Library CV 5000 Series Command Code Functions implemented in CV 5000 NET Lib Trigger 1 Ti Trigger Trigger 2 T2 Trigger Changing to RUN RO ChangeModeToRUN Changing to Program mode So ChangeModeToProgram Repeat output measurement MO RepeatOutputMeasurementResult results Writing the program number PW SwitchProgramNumber Reading the program number PR ReadCurrentProgramNumber Writing the window number UW SwitchWindowNumber Reading the window number UR ReadCurrentWindowNumber Display switching DS SwitchDisplayTemplate SwitchResultDisplay SwitchPageNumber SwitchPageNext SwitchPagePrevious SwitchScreen Screen capture BC SaveScreenCapturelmage RequestScreenCapture Image registration BS Registerlmage Retrieving a list of registered BL RetrieveListRegisteredImagesCurrentProgram images RetrieveListRegisteredImages Reading the image data BR RequestIlmageData RequestImageDataToSDCard Reading all screen data BT ReadAlllmageDatalnBuffer Writing the program data SW WriteProgramDataToSDDevice WriteProgramDataToCurrentProgram WriteRegisteredlmageToSDDevice WriteRegisteredlmageToCurrentProgram WriteLibraryDataToSDDevice WriteLibraryDataToCurrentProgram Reading the program data SR ReadProgramDataFromSDDe
12. Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 38 Method WriteBinaryFilterData Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteBinaryFilterData int windowNumber int upperLimit int lowerLimit JW windowNumber 0 to 127 upperLimit Upper limit of window lowerLimit Lower limit of window None RUN Writes the upper and lower limit on the binary filter of the specified filter ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of JW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode JW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteBinaryFilterData 0 100 10 _cv5000 WriteBinaryFilterData 0 100 10 79 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement
13. End Sub Private Sub tmrTrigger_Tick ByVal sender As System Object ByVal e As System EventArgs Handles tmrTrigger Tick _cv5000 Trigger 1 End Sub Private Sub btnStart_Click ByVal sender As System Object ByVal e As System EventArgs Handles btnStart Click Trigger the CV 5000 device now _cv5000 Trigger 1 Set the interval and start the timer tmrTrigger Interval 5000 tmrTrigger Enabled True End Sub Private Sub btnStop_Click ByVal sender As System Object ByVal e As System EventArgs Handles btnStop Click Stop the timer tmrTrigger Enabled False End Sub Delegate Sub UpdateBitmapDelegate ByVal bmp As Bitmap 111 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Add image to picturebox Private Sub UpdateBitmap ByVal bmp As Bitmap Dim oldBitmap As Bitmap oldBitmap picPartImage Image If Not oldBitmap Is Nothing Then oldBitmap Dispose End If picPartImage Image bmp End Sub Update picturebox use invoke if necessary Private Sub SetBitmap ByVal bmp As Bitmap If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateBitmapDelegate AddressOf UpdateBitmap bmp Else UpdateBitmap bmp End If End Sub End Class 112 Date August 19 2010 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement
14. Error Port Property CVDataPort CVPort enumeration cv5000 WriteToCommandMemory pos val _cv5000 WriteToCommandMemory pos val 83 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 43 Method ReadFromCommandMemory Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadFromCommandMemory int memoryPosition MR memoryPosition 0 to 999 None RUN Read value from command memory ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of MR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode MR ResultData Memory value as a string RecMode Property CommandMemory CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ReadFromCommandMemory 0 _cv5000 ReadFromCommandMemory 0 84 Use or disclosure of data on this page
15. INTERRUPTION LOSS OF BUSINESS INFORMATION OR ANY OTHER PECUNIARY LOSS ARISING OUT OF THE USE Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 OF OR INABILITY TO USE THE SOFTWARE PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES EVEN IF CONQUEST HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES IN ANY CASE CONQUEST S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS EULA SHALL BE LIMITED TO THE AMOUNT CUSTOMER ACTUALLY PAID TO CONQUEST FOR THE SOFTWARE PRODUCT OR SERVICE THAT DIRECTLY CAUSED THE DAMAGE CUSTOMER and CONQUEST are independent parties Nothing in this EULA shall be construed as making CUSTOMER an employee agent or legal representative of CONQUEST This EULA constitutes the complete and entire statement of all terms conditions and representations of the agreement between CUSTOMER and CONQUEST with respect to the Software Product CUSTOMER agrees to abide by all applicable laws with regard to the use sale and export of the Software Product This EULA is governed by the laws of the State of Connecticut without regard to conflicts of law principles CUSTOMER hereby consents to the exclusive jurisdiction of the courts of the State of Connecticut for the resolution of any dispute arising out of or related to this EULA and or use of the Product Software The failure of CONQUEST to insist i
16. NET library detects a lost connection to the CV 5000 series device Note that the CV 5000 NET library can only detect a lost connection if it attempts to send data to the CV 5000 series device after the network connection is lost To test the network connection send an EchoText command This event has no event arguments 6 2 7 Event ConnectionClosedByProgram This event is fired after the host application calls the CloseConnection function in the CV 5000 NET Library This event has no event arguments 35 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 3 Communication Methods 6 3 1 Method Connect Method Signature Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public bool Connect None Boolean True connection attempted False Error connection not attempted ALL Requests a connection to the CV 5000 series device This method must be called before any other methods can be called ErrorOccurred event triggered N A If a successful connection is made both the ConnectionEstablished and ImageConnectionEstablished events will be triggered cv5000 Connect _cv5000 Connect 6 3 2 Method CloseConnection Method Signature Parameters Return Type CV Modes Description Method Error CV Error
17. None RUN Retrieves a list of registered images that have been previously saved to a SD Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of BL The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode BL ResultData List of Registred images seperated by commas Example 000 001 004 RecMode Property ListReglmages CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 RetrieveListRegisteredImages 1 0 SDOptions SDCard1 _cv5000 RetrieveListRegisteredImages 1 0 SDOptions SDCard1 60 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 20 Method RequestimageData Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void RequestlmageData int cameraNumber CompressionRatio compressionRatio Specifie
18. Options WEP Viow Rar Zooe in out Change display view S00 Wore tions For more information on connecting your CV 5000 series device see the CV 5002 Series instruction manual 6 1 4 Property RemotePort Type Integer This property must be set to the port number that the CV 5000 series device is currently using for the data transmission This property must be set before calling any of the methods To change or view the Ethernet settings of your CV 5000 see the instructions in the earlier section Property RemoteHost 6 1 5 Property RemotelmagePort Type Integer This property must be set to the port number that the CV 5000 series device is currently using for the image transmission This property must be set before calling any of the methods To change or view the Ethernet settings of your CV 5000 see the instructions in the earlier section Property RemoteHost 28 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 1 6 Property DebugMode_LogToFile Type Boolean This property can be set to True to assist developers in troubleshooting communications errors with the CV 5000 series device When enabled the CV 5000 NET Library will log all communications between the PC and the CV 5000 series device to an ASCII log file given the name date log where date is the current date The binary transmissions will be saved in
19. PREFACE The CV 5000 Series NET Library Developers Guide is not intended to replace the CV 5202 User s Manual This guide assumes the user is familiar with the basic setup and operation of the CV 5000 Series Camera System Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 3 OVERVIEW OF THE CV 5000 NET LIBRARY The CV 5000 NET Library allows NET programmers to quickly and easily communicate with the Keyence CV 5000 via Ethernet The CV 5000 NET Library contains a single control named CV5000_Series dll that encapsulates all of the Ethernet based functionality of the Keyence CV 5000 series cameras The CV 5000 NET Library supports a vast array of features including but not limited to e Managing the TCP connection to your CV 5000 series device e Support for all CV 5000 Ethernet based functions in RUN and PROGRAM modes e Data and image acquisition methods The CV 5000 NET Library provides support for a range of methods from sending low level raw commands to execution of high level CV 5000 functionality The CV 5000 NET Library allows your application maximum CPU time when waiting for processes that take an extended period of time e g screen captures Communication methods return immediately after data is sent to the CV 5000 device and whenever the data is available from the CV 5000 NET Library an event is triggered
20. Property Byte array containing registered image RecMode Property ReglmageJPEG or ReglmageBMP CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 ReadRegisteredImageFromCurrentProgram 1 0 _cv5000 ReadRegisteredlmageFromCurrentProgram 1 0 73 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 33 Method ReadLibraryDataFromSDDevice TBD Update DataEventArgs Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadLibraryDataFromSDDevice int programNumber int libraryNumber SDOptions option SR DC programNumber 0 to 999 libraryNumber 0 to 999 option SDOption enumeration SDCard1 or SDCard2 None RUN Reads library data from a SD Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of SR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the insta
21. device None RUN Disables a communications port requires a password ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of LK The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode LK RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 DisableCommunicationsPort CommunicationsPort El pw _cv5000 DisableCommunicationsPort _ CommunicationsPort El pw 99 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 59 Method ChangePassword Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ChangePassword string oldPassword string newPassword PS oldPassword string containing pw set in CV Series device newPassword string containing new pw to set in CV Series device None RUN Changes t
22. following code to the end of the DataReceived event handler Public Class Forml Private Sub DataReceived ByVal args As DataEventArgs Dim Str As String If args ASCIIData Length gt 30 Then Str args ASCIIData Substring 0 30 Tags Else Str args ASCIIData End If If args RecMode CVRecMode CVError Then SetMeasurementData Str ElseIf args Port CVPort CVDataPort Then SetMeasurementData Str End If If args RecMode CVRecMode TrigImageData _ Or args RecMode CVRecMode RegIimageBMP _ Or args RecMode CVRecMode ScreenCapture Then SetBitmap args Bitmap End If End Sub End Class 25 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 6 3 Running the Complete Sample Program Run the program and the program should display both the measurement data and an image with each trigger You may want to pass your hand in front of the camera to be sure that the image is changing Again the image will be triggered once every 5 seconds so you may want to wait a few seconds ES Form1 T1 0120093 1 09 06 05 19 45 06 71 0120070 1 09 06 05 19 45 11 71 0355747 1 09 06 05 19 45 16 T1 0120093 1 09 06 05 19 45 21 T1 0120002 1 09 06 05 19 45 26 71 0357115 1 09 06 05 19 45 31 T1 0120001 1 09 06 05 19 45 36 71 0357050 1 09 06 05 19 45 41 T1 0119820 1 09 06 05 19 45 46
23. for CUSTOMERs eligibility for such upgrade CUSTOMER may use the resulting upgraded product only in accordance with the terms of this EULA If the Software Product is an upgrade of a component of a package of software programs that CUSTOMER licensed as a single product the Software Product may be used and transferred only as part of that single product package and may not be separated for use on more than one computer 5 TERMINATION Without prejudice to any of CONQUEST S other rights CONQUEST may immediately terminate this EULA if CUSTOMER fails to comply with the terms and conditions of this EULA In such event CUSTOMER must immediately cease all use of the Software Product and delete any and all copies of the Software Product and all of its component parts 6 MISCELLANEOUS THE SOFTWARE PRODUCT IS PROVIDED AS IS AND CONQUEST CONSULTING DISCLAIMS ALL WARRANTIES AND CONDITIONS EITHER EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE TITLE AND NON INFRINGEMENT CONQUEST MAKES NO WARRANTY THAT ALL ERRORS HAVE BEEN OR CAN BE ELIMINATED FROM THE SOFTWARE PRODUCT OR DOCUMENTATION CUSTOMER ACKNOWLEDGES AND AGREES THAT ANY USE OF THE SOFTWARE PRODUCT IS AT THE SOLE RISK OF CUSTOMER IN NO EVENT SHALL CONQUEST BE LIABLE FOR ANY SPECIAL INCIDENTAL INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS PROFITS BUSINESS
24. for the DataReceived event are defined by the DataEventArgs class The DataEventArgs class has the following public properties RawData Property Type Array of Bytes This property will return the entire packet of data received by the CV 5000 series device Most applications will not need to use this information The other properties in the DataEventArgs class will provide more useful information to the host application CommandCode Property Type String This property contains the command code received two character string for the data received from the CV 5000 series device This command code can be used by the application to match up commands sent to the CV 5000 series device with the responses received from the CV 5000 series device CommandCode2 Property Type String This property is used if the CommandCode property was ER In this case the CommandCode2 property will contain the command sent to the CV 5000 series device that resulted in an error response from the device DataType Property Type CVDataType This property indicates the type of data returned from the CV 5000 series device The CVDataType enumeration will contain one of the following values e ASCII e Binary e Error e Unknown If the DataType property contains a value of ASCII or a value of Binary then no errors happened and the DataEventArgs object contains valid data If the CV Device rejected the command the DataType property will co
25. int programNumber SDOptions sdOption PW programNumber Program number in CV 5000 series device 0 to 999 sdOption SDOptions enumeration Specifies which SD card program is written to None RUN Closes all the displayed program screens and switches to the specified program number ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of PW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode PW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SwitchProgramNumber 0 SDOptions SDCard1 _cv5000 SwitchProgramNumber 0 SDOptions SDCard1 46 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 6 Method ReadCurrentProgramNumber Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadCurre
26. is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 44 Method SetlnitialValuesForCommandMemory Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SetlnitialValuesForCommandMemory MI None None RUN Sets all of the current command memory values as the initial values for the command memory ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of Ml The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode MI RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SetlnitialValuesForCommandMemory _cv5000 SetInitialValuesForCommandMemory 85 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 45 Method Chan
27. of this document Conquest Consulting LLC
28. port requires a password ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of KY The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode KY RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 RemoteControlPseudolnput RemotelnputCodes TG _cv5000 RemoteControlPseudolnput RemotelnputCodes TG 101 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 6 4 61 Method EchoText Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example Date August 19 2010 public void EchoText string text EC text text to echo back None RUN Returns a string that has been sent to the CV Device Used to test communication with the CV Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event
29. public void RepeatOutputMeasurementResult Mo None None RUN Outputs the most recent measurement result again When automatic image output is set the image data is also output ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of MO The error that the device returned will be in the ErrorCode property of the DataEventArgs object At least one DataReceived event will be fired for the data received over the CVDataPort A second DataReceived event may be fired for data received over the CVImagePort depending on how the CV device is configured If no measurement data is received then the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode MO depending on which trigger was triggered RecMode Property RecTrigNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration If measurement data is received then the following properties will be set in the instance of DataEventArgs received over the CVDataPort ResultData String containing result data from the trigger See CV 5002 Series manual to interpret the data CommandCode MO depending on which trigger was triggered RecMode Property TrigRe
30. the UpdateStatus method directly otherwise we have to use the delegate method UpdateStringDelegate to call the UpdateStatus method As you can see from the code above the updateStringDelegate defines a method signature that can be used with the Invoke Method to update a Windows Forms GUI control and its signature is compatible with the UupdateStatus method To boil the Microsoft tech speak into English what this means is that the UpdateStringDelegate method and the UpdateStatus method have the same return type in this case none and the same parameter list NOTE See the following article in Microsoft s documentation for more information on this concept http msdn microsoft com en us library system windows forms control invokerequired aspx 18 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 4 5 Closing Connections Before the application shuts down you should close your connection to the CV 5000 To do this the CloseConnection method in the CV 5000 NET Library should be called Add a form closing method to the sample application and add a call to CloseConnection as shown below Public Class Forml Private Sub Forml_FormClosing ByVal sender As System Object _ ByVal e As System Windows Forms FormClosingEventArgs Handles MyBase FormClosing _cv5000 CloseConnection End Sub End Class 5 4 6 Run
31. thread safe manner Since Windows forms controls are not thread safe the controls on the form cannot be directly updated from the event handlers in the application Therefore the creation of a thread safe method is required to update any of the controls on the form The sample application has a status field that is updated whenever a significant event has happened The code below shows how to use the CV 5000 NET Library in a thread safe way to update the status field in the application Add the following methods to the form s class Public Class Forml Delegate defines function used to update GUI in a threadsafe manner Delegate Sub UpdateStringDelegate ByVal entry As String Called with an invoke when udating txtStatus in event handler Private Sub UpdateStatus ByVal entry As String txtStatus Text entry vbCrLf txtStatus Text End Sub Update status TextBox use invoke if necessary Private Sub SetStatus ByVal entry As String If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateStringDelegate AddressOf UpdateStatus entry Else Thread safe call update control directly UpdateStatus entry End Lf End Sub End Class The Set Status method checks a flag InvokeRequired that is supplied by the NET Framework which lets the user know if the event was raised in the user interface thread or not If the event was raised in the user interface thread InvokeRequired False then we can call
32. to allow your application to access the received data 3 1 Minimum System Requirements e Microsoft Windows XP or Windows Vista e Microsoft NET Framework 2 0 e Ethernet interface 25 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 4 GETTING STARTED 4 1 Installing the CV 5000 NET Library Locate the Installation Program setup exe that you downloaded from the website Make sure that CV5000LibSetup msi is in the same directory as setup exe Run the installation program and follow the commands below i CV 5000 Net Library Welcome to the CV 5000 Net Library Setup Wizard The installer will guide you through the steps required to install CV 5000 Net Library on your computer WARNING This computer program is protected by copyright law and international treaties Unauthorized duplication or distribution of this program or any portion of it may result in severe civil or criminal penalties and will be prosecuted to the maximum extent possible under the law Click Next to continue i CV 5000 Net Library Select Installation Folder The installer will install CV 5000 Net Library to the following folder To install in this folder click Next To install to a different folder enter it below or click Browse Folder C Program Files Conquest CV 5000 Net Library Install CV 5000 Net Library
33. with the terms of the License Agreement is expressly prohibited 1 SOFTWARE PRODUCT LICENSE The Software Product is protected by domestic and international intellectual property laws and treaties The Software Product is licensed not sold As such this EULA confers no title or ownership in the Software Product Pursuant to CUSTOMER accepting all the terms and conditions of this EULA CONQUEST grants to CUSTOMER a personal exclusive license to install and use the Software Product on any computer owned by CUSTOMER and operated by CUSTOMER and its employs Without the expressed written consent of CONQUEST CUSTOMER is not entitled to sell grant a security interest in or transfer reproductions of the Program to other parties either an individual person or a single legal entity not owned and operated by CUSTOMER in any way nor to rent lease or license the Program to others either an individual person or a single legal entity not owned and operated by CUSTOMER If CUSTOMER has acquired this Software Product in a CONQUEST License Pack or Corporate Site License Agreement CUSTOMER may make the number of additional copies of the computer software portion of the Software Product as defined on that License Pack or Corporate Site License and CUSTOMER may use each copy in the manner specified above and below 2 OWNERSHIP Unless otherwise noted all right title and interests in the Software Product are owned by CONQUEST including any accompa
34. 1 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date August 19 2010 5 5 3 Setting up the Timer The timer will be the source of triggers to the CV 5000 series device Each time the timer expires it will send a trigger to the CV Double click on the tmrTrigger control to add a handler for the timer event and add the following code to the event Private Sub tmrTrigger_Tick ByVal sender As System Object ByVal e As System EventArgs Handles tmrTrigger Tick _cv5000 Trigger 1 End Sub 5 5 4 Setting up the Start and Stop Buttons The start and stop buttons on the form will enable and disable the timer on the form Create event handlers by double clicking on the buttons and add the following code to the application Private Sub btnStart_Click ByVal sender As System Object ByVal e As System EventArgs Handles btnStart Click Trigger the CV 5000 device now _cv5000 Trigger 1 tmrTrigger Interval 5000 tmrTrigger Enabled True End Sub Private Sub btnStop_Click ByVal sender As System Object ByVal e As System EventArgs Handles btnStop Click tmrTrigger Enabled False End Sub 22 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 5 5 Running the Applica
35. 1 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 41 Method ReadWindowCalculationValue Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadWindowCalculationValue int windowNumber WindowType windowType string symbol ieasuredValueLimit measuredValueLimit DR windowNumber 0 to 127 windowType WindowType enumeration MeasurementWindow or CalculationWindow symbol See page 4 258 in the CV 5002 Series User s Manual measuredValueLimit MeasuredValueLimit enumeration HL or LL None RUN Reads the calculation window or limits ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of DR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DR ResultData Limit Value as a string RecMode Property WindowLimit CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property A
36. 4 registeredlmageNumber 0 to 999 None RUN Registers the latest image specified by the camera number ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of BS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode BS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 Registerlmage 1 0 _cv5000 Registerlmage 1 0 58 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 18 Method RetrieveListRegisteredimagesCurrentProgram Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void RetrieveListRegisteredImagesCurrentProgram int cameraNumber BL CP cameraNumber 1 to 4 None RUN Retrieves a list of registered images that have been previously saved in the current program ErrorOccurred eve
37. 71 0119767 1 09 06 05 19 45 51 T1 0119979 1 09 06 05 19 45 56 T1 0120095 1 09 06 05 19 46 01 T1 0120011 1 09 06 05 19 46 06 T1 0120047 1 09 06 05 19 46 11 T1 0120034 1 09 06 05 19 46 16 T1 0120028 1 09 06 05 19 46 21 Image port connected Command port connected If you ran into an error while creating the code in this section Appendix A 3 contains a listing of the complete code CONGRATULATIONS You have just completed your first program 26 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 THE CV 5000 NET LIBRARY REFERENCE The CV 5000 NET Library contains a single NET Assembly called CV5000_Series dll The CV 5000 NET library provides the complete Ethernet interface to your CV 5000 series device The library contains properties methods and events which the user can use to create a custom CV 5000 application 6 1 Properties Most of the CV 5000 NET Library property values are used in the initial setup of the control 6 1 1 Property Name Type String This property can be used for applications that have more than one instance of the CV 5000 class Once this property is set the CV 5000 s ToString method will return the instance s name For example Private _cv5000 As cv5000 _cv5000 Name CVTest str _cv5000 ToString In the case shown above sir would contain
38. 8 211 Link our handlers to the events being created by the CV 5000 AddHandler _cv5000 ConnectionEstablished AddressOf ConnectionEstablished AddHandler _cv5000 ImageConnectionEstablished AddressOf ImageConnectionEstablished AddHandler _cv5000 ErrorOccurred AddressOf ErrorOccurred Connect to the CV 5000 series device _cv5000 Connect Now that the hooks are in place we can add the event handlers Add the following methods to the form s class definition The Set Status method is defined in the next section Public Class Forml Triggered when the command port is connected to Private Sub ConnectionEstablished SetStatus Command port connected End Sub Triggered when the image port is connected to Private Sub ImageConnectionEstablished SetStatus Image port connected End Sub Private Sub ErrorOccurred ByVal args As ErrorOccurredEventArgs If Not args ExceptionCaught Is Nothing Then MessageBox Show args ErrorMessage _ args ExceptionCaught ToString Else MessageBox Show args ErrorMessage End If End Sub End Class 247 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 4 4 Updating the Status Textbox in a Thread safe Manner The CV 5000 NET Library uses independent threads to poll for data from the CV 5000 device Because of this it is necessary to create your application in a
39. C in the End User License Agreement of this document Date August 19 2010 6 4 15 Method SaveScreenCapturelmage Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SaveScreenCapturelmage BC CF None None RUN Saves the current image to the SD Card 2 Run or Program mode ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of BC The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode BC RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SaveScreenCapturelmage _cv5000 SaveScreenCapturelmage 56 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 16 Method RequestScreenCapture Method Signature Base CV Command Parameters Return Type CV Modes Description Method E
40. CVTest An example of where this would be useful is when used with the Windows Forms ComboBox Simply add all the CV 5000 instances to the ComboBox s Items collection and the CV 5000 instance names will automatically be shown in the ComboBox s list 6 1 2 Property Password Type String The CV 5000 Net Library requires that the developer provide the correct password to unlock the control Without the password the control will not function This password will be provided by Conquest Consulting on the purchase of the CV 5000 Net Library This property is no longer required 27 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 1 3 Property RemoteHost This property must be set to the IP address of the CV 5000 series device This property must be set before calling any of the methods To change or view the Ethernet settings of your CV 5000 device 1 While in PROGRAM mode select Global on the top right of the screen and click on Ethernet Network Settings 2 You will be able to change or view the Ethernet IP address and or ports from here lew Prog000 New003 Utility Display ma Canora Seat 25 Default gatouay 192 168 eae T a EEn F Calo Port mmber for iuo a Regist Image File Type a cean a peeatari VeW View Bar Zoon in out Change display view S0 More
41. Code of ER and a CommandCode2 of TE The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode TE RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 TriggerInputDisable _cv5000 TriggerlnputDisable 97 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 57 Method EnableCommunicationsPort Method Signature Base CV Command Parameters Password Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void EnableCommunicationsPort CommunicationsPort communication string password LK ON communication CommunicationsPort enumeration The value can be one of the following RS RS 232 PL PLC US USB ET Ethernet CC CC Link El Ethernet IP CN Remote Control Console string containing pw set in CV Series device None RUN Enables a communications port requires a password ErrorOccurred event triggered The CV 5000 Series device will retu
42. CompressionRatio One Specifiedlmage OK CV TEST omp _cv5000 RequestImageDataToSDCard 1 CompressionRatio One Specifiedlmage OK CV TEST bmp 62 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 22 Method ReadAlllmageDatalnBuffer Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadAlllmageDatalnBuffer int cameraNumber CompressionRatio compressionRatio Specifiedi mage specifiedImage string folderName BT cameraNumber 1 to 4 compressionRatio CompressionRatio enumeration One OneHalf OneQuarter or OneEigth specifiedImage Specifiedlmage enumeration NW NG or OK folderName Name of folder in SD card to save images None RUN All the images that are stored in the image buffer are written to the SD card in bitmap format ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of BT The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPor
43. Date August 19 2010 User s Manual for the CV 5000 NET Library Prepared by CONQUEST CONSULTING LLC www conquestsolutions com Copyright 2010 This document contains information which is the property of Conquest Consulting LLC Except for rights expressly granted by contract this document may not in whole or in part be duplicated or disclosed without prior written permission Date August 19 2010 Revision History Revision Retessestus te 1 0 0 1 Initial Release 2009 08 05 4 3 4 4 5 3 5 6 1 6 1 2 6 1 6 amp 6 1 7 6 1 8 6 2 5 6 4 63 A 3 5 4 2 A 1 A 2 A 3 Added Activation Tool and Activation Log to the program menu Removed auto 2009 11 18 creation of distribution license Added entire section which shows how to activate the library Removed auto creation of distribution license Added entire section which explains trial mode Added Stretch Image size mode setting to the Picture Box Modified the code to update the picture box Password no longer required Updated DebugMode_LogToFile to include the directories in which the debug files are stored Added section to explain the Binary Dump error logging Updated the bitmap property definition to include information on disposing of the bitmap Added WritelmageToDisk method Updated code to acquire the bitmap image Removed setting of password from sample code Removed setting of password from sample code
44. Event ImageConnectionEstablished This event is fired when the application successfully connects with the image port of the CV 5000 series device The host application should monitor this event to insure that images can be received from the CV 5000 series device This event has no event arguments 6 2 4 Event DataSent This event is fired when the application sends a command to the CV 5000 series device This event will be fired if the application was able to send a command to the CV 5000 series device Receiving this event does not indicate that the CV 5000 device actually received the transmission Monitor the DataReceived event for confirmation that the command was received by the CV 5000 series device The event arguments for the DataSent event are defined by the DataSentEventArgs class The DataSentEventArgs class has the following public properties Data Type String Command that was sent to the CV 5000 Series Device 32 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 6 2 5 Date August 19 2010 Event DataReceived This event is fired when the application receives data from the CV 5000 Series Device on either the data port or the image port This event can be triggered as a response to a command sent to the CV 5000 Series device or an unsolicited communication from the CV 5000 series device to the application The event arguments
45. K you will have a blank project open that looks similar to the screen below If the solution explorer is not open see right hand side of image below you will need to open it by clicking View Solution Explorer on the Visual Studio menu Mtm Pe Me nates te Te ld pened pea esien 12 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 2 Adding a Reference to the CV 5000 NET Library Before you can use the CV 5000 NET Library in your application you must add a reference to it in your code This will allow you to access the properties and methods of the CV 5000 NET Library 1 Inthe Solution Explorer right click on CV5000_Sample_Project and select Add Reference aA Simon cve Sange Project 1 projet iiiir 5 2s My Project 5 as Brom Rebuld Chan bish ass Ad Web Reference Ey Vien Chaos Congr Set as Rate Project Oxbua aS adi Soktu to Source Control A X Remove Benare tioi Propet J Open Folder n Windows Explorer 2 Click on the browse tab and navigate to the directory where the CV 5000 NET Library was installed The default directory is C Program Files Conquest CV 5000 Net Library Select CV5000_Series dll and then click OK Add Reference 7 Add Reference net COM Projects Browse Recent E Look in CV 5000 Net Library J0 2 em in J0 2 e m CY ies S
46. LLC in the End User License Agreement of this document Date August 19 2010 6 4 3 Method ChangeModeToProgram Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ChangeModeToProgram SO None None RUN Changes mode from RUN to PROGRAM ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of SO The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode S0 RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ChangeModeToProgram _cv5000 ChangeModeToProgram 43 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 6 4 4 Date August 19 2010 Method RepeatOutputMeasurementResult Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success
47. Property ReglmageJPEG or ReglmageBMP CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 ReadRegisteredImageFromSDDevice 0 1 0 SDOptions SDCard1 _cv5000 ReadRegisteredimageFromSDDevice 0 1 0 _ SDOptions SDCard1 72 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 32 Method ReadRegisteredimageFromCurrentProgram Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadRegisteredlmageFromCurrentProgram int cameraNumber int registeredlmageNumber SR BD CP cameraNumber 1 to 4 registeredlmageNumber 0 to 999 None RUN Reads registered image from the current program ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of SR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SR BinaryData
48. RequestScre nCapture ccccccccsccceseeceencecseeeeensecseneeeceanetenaecseneecseneeseassseseesenenessnees 57 6 4 17 Method Registerlmage u scccccsccccesceceencecesneseacecscneecsansssnaecsaeecsnessanaecseaeecsuetessaseaeaeessenneteatass 58 6 4 18 Method RetrieveListRegisteredl MageSCurrentProQram cccccccecseceseneeceeetesseeteeetenetetsnees 59 6 4 19 Method RetrieveListRegisteredlmages cssccccsccesessseeneeceeneecennesensecseneecenetessaseeseseesenneetnaees 60 6 4 20 Method RequesthmageD ata 2 cccccccccecceceesceensecenececeneessaeecseeeecenessnaesseneeceuesessaseseneeeenaeeteaes 61 6 4 21 Method Requestlmage TOSDCAIC sscccececccesseceenceceneeeeaeceeneeceaeesenaecseneecsunsessassesneessesnettnaees 62 6 4 22 Method ReadAlllmageDatalnBulter cccccccccccecceccecesscsensecceeeecsnnessaeeceeneessnstssseeseneetenssessaees 63 iv Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 23 Method WriteProgramDataTOSDDOVICE 2 ccccceceecceeenecseeeeceneeeeaaecseneecenetsesaaeeseneeteneeetaees 64 6 4 24 Method WriteProgramData TOCUITENtPOQrai ccccccccccsceccenceceneeesneecseseecsestessnaeeseneeteentetiaees 65 6 4 25 Method WriteRegisteredi Mage ToSDDevice 2 cccceccesstecceeneeteneeteseceeneecseneetsaeeeseneeteeneesnaees 66 6 4 26 Method WriteRegisteredi mage TOCUrre
49. SCII Port Property CVDataPort CVPort enumeration cv5000 ReadWindowCalculationValue 0 WindowType MeasurementWindow X MeasuredValueLimit HL _cv5000 ReadWindowCalculationValue 0 WindowType MeasurementWindow X _ MeasuredValueLimit HL 82 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 42 Method WriteToCommandMemory Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteToCommandMemory int commandMemoryPositions int commandMemoryValues MW commandMemoryPositions array of integers commandMemoryValues array of integers None RUN Write to command memory ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of MW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode MW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No
50. Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void RequestImageDataT oSDCard int cameraNumber CompressionRatio compressionRatio Specifiedimage specifiedImage string fileName BR CF cameraNumber 1 to 4 compressionRatio CompressionRatio enumeration One OneHalf OneQuarter or OneEigth specifiedImage Specifiedlmage enumeration NW NG or OK filename Example CV TEST bmp None RUN The current image data that is stored in the image buffer is written to the SD Card in bitmap format ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of BR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode BR ResultData c t nannnnnnnnn c camera number 1 to 4 t Total Status 0 OK 1 NG nnnnnnnnnn Measurement CountBinaryData Byte array of the Bitmap Image RecMode Property SavedReglmageData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 RequestImageDataToSDCard 1
51. V 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of DS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SwitchPageNumber 0 _cv5000 SwitchPageNumber 0 52 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 12 Method SwitchPageNext Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SwitchPageNext DS PG None None RUN Displays the next page ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of DS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired a
52. a Length gt 30 Then Str args ASCIIData Substring 0 30 Else Str args ASCIIData End If If args RecMode CVRecMode CVError Then SetMeasurementData Str ElseIf args Port CVPort CVDataPort Then SetMeasurementData Str End If End Sub Private Sub tmrTrigger_Tick ByVal sender As System Object ByVal e As System EventArgs Handles tmrTrigger Tick _cv5000 Trigger 1 End Sub Private Sub btnStart_Click ByVal sender As System Object ByVal e As System EventArgs Handles btnStart Click Trigger the CV 5000 device now _cv5000 Trigger 1 tmrTrigger Interval 5000 tmrTrigger Enabled True End Sub Private Sub btnStop_Click ByVal sender As System Object ByVal e As System EventArgs Handles btnStop Click tmrTrigger Enabled False End Sub End Class 109 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document A 3 Date August 19 2010 COMPLETE CODE LISTING Imports CV5000_Series Public Class Forml Private _CV5000 As CV5000 Private Sub Forml_Load ByVal sender As System Object ByVal e As System EventArgs Handles MyBase Load Create an instance of the CV 5000 library _ CV5000 New CV5000 Set up the CV 5000 I P address and port information _cv5000 RemotePort 8500 _cv5000 RemoteImagePort 8501 _cv5000 RemoteHost 192 168 168 211 Add the event handlers AddHandler _cv5000 C
53. and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of UR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode UR Result Property Returned window number 0 127 Returns 0 if no window is set RecMode Property WindowNumber CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 ReadCurrentWindowNumber _cv5000 ReadCurrentWindowNumber 49 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 9 Method SwitchDisplayTemplate Method Signature Base CV Command Parameters Raw_Screen Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SwitchDisplayTemplate DisplaySwitching TemplateNumber template DS PT template Value in DisplaySwitchingTemplateNumber Enumeration The value can be one of the following Filtered_Screen_1 Filtered_Screen_2 Contrast_View User_Defined_Template_1 User_Defined_Template_2 User_Defined_Template_3 U
54. at the library was doing when the error occurred The CVErrorType enumeration will contain one of the following values Test_Error Connect_Error ImageConnectCallback_Error ConnectCallback_Error Disconnect_Error SendRawCmd_ Error SendRawCmdaArray_Error SendRawCmdCallback_Error ResetCommand_Error Trigger_Error ReadImage_Error ReceiveDate_Error GetImageData_Bitmap_Error Retrievelmages_Error ChangeCurrentProgramNumber_Error Misc_Error ReadCurrentProgramNumber_Error SwitchDisplayTemplate_Error SwitchResultDisplay_Error SwitchPage_Error SwitchScreen_Error 30 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document SwitchScreenNumber_Error RepeatOutputMeasurementResult_Error ChangeCurrentWindowNumber_Error ReadCurrentWindowNumber_Error WriteProgramData_Error RequestProgramData_Error RequestCurrentProgramData_Error WriteEnvironmentalSettings Error RequestEnvironmentalSettings_ Error RetrievingListOfLibraryNumbers_Error WriteBinaryFilterData_Error ReadBinaryFilterData_Error Registerlmage_Error RequestImageData_Error RequestImageDataToSDCard_Error ChangeModeToRUN_Error ChangeModeToProgram_Error RequestScreenCapture_Error SaveScreenCapturelmage_Error RetrieveListRegisteredImages_Error ChangeShutterSpeed_Error ChangeCameraSensitivity_Error SetTriggerDelay_Error SetLightIntensityValue_Error SetExtens
55. ayed to the user and saved to disk This program will use a single camera and a single window aite Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 1 Setting up your Program Launch Visual Studio 2008 and create a new VB NET Forms application by selecting a Visual Basic project type along with the Windows Forms Application project template NOTE The SDK can be used with any NET language such as C Make sure that the NET Framework is set to 2 0 and give the project the name CV5200_Sample_Project as shown below Then press the OK button to continue New Project NET Framework 2 0 Project types Templates Visual Basic isual Studio installed templates Windows Web El Windows Forms Application Class Library Smart Device EA Console Application DE Empty Project Office al Windows Service Gel Windows Forms Control Library Database Reporting My Templates Test E WCF Search Online Templates Workflow Visual C Visual C 4 Other Project Types Test Projects 4 project for creating an application with a Windows user interface NET Framework 2 0 Name C 5200_Sample_Project Location C Documents and Settings Conquest My Documents visual Studio 2008 Projects v Solution Name C 5200_Sample_Project Create directory for solution Once you click on O
56. ccccccccccccecseeceeneeceeececeneeeeaeececneeceanesenaecseneecsnnsssaaseseneeersnnssiaes 103 6 4 63 Method Writel mage TODISK 1scccccccccceccecsseceeneececececeanessnaecsuenecaessenseceeeeessunetsasseeeeeetsnnetenes 103 6 5 SUDDOM se ssvevtis sasicceeeinsi il eee ele is eee aa dy ee eel 104 APPENDIX A COG LISUIIGS siaaa i sect dnadedsbbe bade faves a aaraa su Aa Taaa aaraa te ra Vaaa aa taana 105 y Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 Ail Connection Code CiO e icctevte a a see ie ade A aaa rego oe aa kee 106 A 2 Measurement Data Code Listing 1 ccccccccssceceencecennessnacecseneeseaneeanaecseneeceaneseanssanseseeanersnnsnanes 108 A 3 Complete Code Listing cise wiciis ce ntievet aceite e aa a YALL oie dea aaa shee 110 a vi gt Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 1 END USER LICENSE AGREEMENT FOR CONQUEST CONSULTING CV 5000 SERIES NET LIBRARY IMPORTANT READ CAREFULLY This Software End User License Agreement EULA is a legal agreement between you either an individual person or a single legal entity hereinafter referred to as CUSTOMER and CONQUEST CONSULTING LLC hereinafter referred to as CONQUEST with offices at 30 Tower Lane Avo
57. ccccccseccesceeceeeeeensecseeeecseeeessaseseseeetsnnsesnaees 44 6 4 5 Method SwitchProgramNumber cccccccecccescececececeneeesnneeceeneeceeeseasecseneecsentessaseeseneetseesesiaess 46 6 4 6 Method ReadCurrentPrograrmNumbes cccsccccceceeceeeceeneeceeeeeceneesenaecseneecseeeessasssenenetsensesnaess 47 6 4 7 Method SwitChwWindOwNumMbel scccccssscceseeseseseesceseceeaceeseceeaaesecsenaeesseeseeeesseaseeeessenseeeenanes 48 6 4 8 Method ReadCurrentWindowNumMbe r 1 ccccccccccceceeeeeseneeccneeeceeesenaecseneeceneeesssaeeseneesenntessaees 49 6 4 9 Method SwitchDisplay Template 2 ccccccccccccsseceeececeneeesnseecseececenesenaecseaeecseneessaeseseneecsnntesnaees 50 6 4 10 Method SwitchResultDisplay 1 cccccccceecsessseececeeecseneeeaececaeeceeeeessaessseseecenetesaseseneesenenetseees 51 6 4 11 Method SwitchPageNumbe ccccccceceeesesscecenececeaesseneecseneeceaneseasesseaeecseeeessaaesseneeseunsetsaees 52 6 4 12 Method SwitChPageNe xt ccccccccccccceencecsseeseneecceecessaesseneeceeeeeceanessnaesseaeecseesessassseseeeteensesiaees 53 6 4 13 Method SwitChPagQePreviOus 1 cccsccccccceceeseseneeceeeeeceeeeesaeecseneeceaeeesaaesseaeeseuneesiaseseeeeeeneeteaees 54 6 4 14 M INOd SWHCNSCIC knne eaa e Sell beak ae a E Theds ebb caesteaedaveeda es 55 6 4 15 Method SaveScreenCapturelmage cccccccccsseecseneeceeeeeensecseaeecseetecsaeesseseecsnetessassseseesseetersness 56 6 4 16 Method
58. cececncecenesesnaecsenceceneeessaesseneecsesneesaaesseasecscaneseanssasaecseneesenntesanes 91 6 4 51 Method REGAD ate Time ou eeececsescccenneceneecneeseneececneecneeeanaecdeaeessaeasanaecseneecsentessassaeaeessennereaness 92 6 4 52 Method RecalculateReference Value cccccccccnceceeeceensecseneeceneeecaeesseneecseesesnastseneecenenersaness 93 6 4 53 Method SavePrograrmSettinGS 221 cccccccccseccsesceceeececsnnessaecseaneeseaeessnaecseanecseetesassaeaeessennsesases 94 6 4 54 Method Reset ssssce svoni hate Bene pies eh as eee eee oi ee ea 95 6 4 55 Method TriggerlnputEnable cccccccccceceeseeesececneecenesessneecseneecsaseseaaecseneecseesessassseseesseetessiaees 96 6 4 56 Method TriggerlnputDisable 2 ccccccceceescceseeceeeeeeceaeeeeneecseneeceanesenaecseseeceentessaseeeneetenseetsness 97 6 4 57 Method EnableComMuniCationSPot ccccccccscccceeeceeeeesnecseneeceuetessnsecseneeceneeessasessneeeseneeesiaes 98 6 4 58 Method Disable COMMUNICAtIONSPOTSK cscccccececeenceceneeesneeceencecenetetsasecseneeceueeessaseseneeeseeneteaaes 99 6 4 59 Method ChangePassword cccceccceecceeenseceenceceneeessaececneeceaeeeseanesenaecedeneessassseneeseeneesennsesaes 100 6 4 60 Method RemoteControlPSCuCOIn Dut ccccccceceecceseseceeneeceneeeceaneseeeeceuneeseassteneecseeeetenneteaes 101 6 4 61 Method EROT OX iiiaae eataa ienie an nd iee eh eee a Aline 102 6 4 62 Method SaveStatisticalD ata
59. ceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 RetrieveListOfLibraryNumbers 0 SDOptions SDCard1 _cv5000 RetrieveListOfLibraryNumbers 0 _ SDOptions SDCard1 76 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 36 Method WriteGlobalSettingsData Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteGlobalSettingsData byte globalSettings SB data Byte array containing global settings None RUN Writes global settings ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of SB The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DB RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPor
60. ceived over the CVDataPort CommandCode SW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteRegisteredImageToCurrentProgram 1 0 data _cv5000 WriteRegisteredImageT oCurrentProgram 1 0 data 67 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 27 Method WriteLibraryDataToSDDevice Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteLibraryDataToSDDevice int programNumber int libraryNumber SDOptions option byte data SW DC programNumber 0 to 999 libraryNumber 0 to 999 option SDOption enumeration SDCard1 or SDCard2 data Byte array containing registered image data None RUN Writes library data to a SD Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of SW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the insta
61. dResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ReadLibraryDataFromCurrentProgram 0 _cv5000 ReadLibraryDataFromCurrentProgram 0 75 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 35 Method RetrieveListOfLibraryNumbers Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void RetrieveListOfLibraryNumbers int programNumber SDOptions sdOption DL programNumber 0 to 999 option SDOption enumeration SDCard1 or SDCard2 None RUN Retrieves a list of library numbers ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of DL The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DL ResultData List of library numbers seperated by commas Example 000 001 004 RecMode Property ListLibraryNumbers CVRe
62. de and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of TW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode TW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SetDateTime 9 6 25 12 0 4 _cv5000 SetDateTime 9 6 25 12 0 4 91 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 51 Method ReadDateTime Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadDateTime TR None None RUN Reads the date and time from the CV Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of TR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following p
63. di mage specifiedImage BR CM cameraNumber 1 to 4 compressionRatio CompressionRatio enumeration One OneHalf OneQuarter or OneEigth specifiedImage Specifiedlmage enumeration NW NG or OK None RUN Retrieves a binary image over the CVCommand Port ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of BR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode BR Bitmap Property Windows Bitmap of Image BinaryData Byte array of the Bitmap Image RecMode Property ReglimageBMP CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 RequestIlmageData 1 CompressionRatio One Specifiedimage OkK _cv5000 RequestImageData 1 CompressionRatio One Specifiedimage Ok 61 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 21 Method RequestiImageToSDCard Method Signature Base CV Command Parameters Return
64. e picture box in the application Add the following methods to the form class Public Class Forml Delegate Sub UpdateBitmapDelegate ByVal bmp As Bitmap Add image to picturebox Private Sub UpdateBitmap ByVal bmp As Bitmap Dim oldBitmap As Bitmap oldBitmap picPartImage Image If Not oldBitmap Is Nothing Then oldBitmap Dispose End If picPartImage Image bmp End Sub Update picturebox use invoke if necessary Private Sub SetBitmap ByVal bmp As Bitmap If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateBitmapDelegate AddressOf UpdateBitmap bmp Else UpdateBitmap bmp End If End Sub End Class The SetBitmap method checks a flag InvokeRequired that is supplied by the Net Framework which lets the user know if the event was raised in the user interface thread or not If the event was raised in the user interface thread InvokeRequired False then we can call the UpdateBitmap method directly otherwise we have to use the delegate method UpdateBitmapDelegate to call the UpdateBitmap method 24 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 6 2 Add Image Data to the Data Received Handler When the data is received we need to call the correct handler based on the type of data being received so add the
65. e day s date The binary dump directories can be found in the following directory XP C Documents and _ Settings Conquest Local Settings Application Data Keyence_CV Vista C Users UserName AppData Local Keyence_CV This option is turned off by default 29 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 2 Events The CV 5000 NET Library follows an event driven model All communication from the CV 5000 NET Library will take place with an event 6 2 1 Event ErrorOccurred This event is fired when there is a problem communicating with the CV 5000 series device This event will NOT be fired if the CV 5000 device rejects the command and returns an Error Code If the CV Device returns an error code that error code will be returned with a DataReceived event The event arguments for the ErrorOccurred event are defined by the ErrorOccurredEventArgs class The ErrorOccurredEventArgs class has the following public properties ErrorMessage Type String description of the error that occurred ExceptionCaught Type Exception this property contains the Exception that caused the communications failure to occur If there was no exception involved in the error then the value of this property will be NULL ErrorType Type CVErrorType Enumeration this value can be used to help pinpoint the cause of the error by indicating wh
66. eeceeensecseneeceeetecsaaecseneecseneessassseseeeseneetsaees 32 Ad Event Data Sent ieai tea aa aI TAEAE E EE T EE AE A e debs cnes 32 6 2 5 Event DataR Ce ive eiiieaenii naii iaaa iin ine iaa adai inkai aa iTia eiiiai aiiai 33 6 2 6 Event CONMOCTIONL OSE sa me aaa aai eaaa cota Sen cap hets aia aapa ai aa iaa iiaa aa Eada aeiia ia 35 6 2 7 Event ConnectionCloSeABy Progra sscccccsceceeececesseeeneeceneeeceaeessnaesseneeceanessaaseeeneeseensetsaees 35 6 3 COMMUNICATION MOthOdS 1 1sccccecccecneeceeeceesnsecseneeceeeesaaecsenaecsuneeceaeessaaesseaeeesenessaaseseneesenetetaees 36 GOT Method COMMOGE S i aa e dead A EA vacaeves sui cddsasddecdessatdeasssadecvelail ees EA 36 6 3 2 Method CIOSCCONMNMECTION s r ena ae a a aa r e a ia eA aaaeaii 36 6 3 3 Method SendRawCommand sssaaa e aa e Aa ea aAa E AE iT naa e 37 6 3 4 Method SCendRAWCOMMANOALTAY cseccceccceeeneececececsneeeeaaecseaeeceetessaaecseseeceeetessaesseneecenetetsaees 37 GiB GV COMMAS vi sjssie ho r35 consis fae 35 5 cong tind db oad coax Sin dy 9S E EE 38 64 1 MOINOOS THO GCM aieri ana aa aa bees cus basa e aa cand Suse aah eee das tans doshas aes 40 6 4 2 Method ChangeMode ToRul 1 ssccccsccecessecsencecenececeesseneecsenceseanesenaesseneececansessaeeseneeceensesiaees 42 6 4 3 Method ChangeMode TOPrograim sscccccscccceneceneceseseeseneecseececeeeseaesseseeeseanstsaaeessneesenneetiaees 43 6 4 4 Method RepeatOutputMeasurementResullt ccccc
67. est Consulting LLC in the End User License Agreement of this document 6 4 54 Method Reset Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example Date August 19 2010 public void Reset RS None None RUN Performs a reset on the CV Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of RS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode RS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 Reset _cv5000 Reset 95 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 55 Method TriggerInputEnable Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void Triggerln
68. evsa My Recent Documents Desktop My Documents 19 My Computer lt HD C Program Files D Conquest e NET COM Projects Browse Recent OFFICE12 E Cw _Pam_9 3 F LaCie G ooo File namel Peat v File name V5000_Series dll 4 Files of ty Sux ke manifest v Files of type Component Files alltb olb ocx exe manifest v ly Network Places Flash Backups HaitStyles 13 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 3 Add Required GUI Components to the Application s Main Form 1 Add a PictureBox to the form and rename it to picPartlmage Set the size mode to Stretchlmage and place in the top left of the form Add a ListBox to the form and rename it IstMeasurementData Place in the top right of the form Add a Button to the form and rename it to btnStart Set the Text Property to Start Add another button to the form and rename it to btnStop Set the Text Property to Stop Add Timer control to the form and rename it to tmrTrigger Add a TextBox to the form and rename it to txtStatus Set the ReadOnly property and the Multiline property to true Place txtStatus in the bottom right of the form DnP After all the controls are laid out the form should look similar the following image RS Formi
69. for yourself or for anyone who uses this computer O Everyone Just me Select the installation folder or leave the default that was provided and click Next to continue Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 i CV 5000 Net Library Confirm Installation Confirm the installation by clicking Next as shown below i CV 5000 Net Library Installation Complete Once the installation has completed click Close Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 4 2 Program Menu The following shortcut will be provided in the Windows Program Menu as shown below fm cv 5000 we C 5000 ae Activation Log we CV S000_ActivationTool e CV 5000 This shortcut will open the directory where the CV 5000 NET library is located The NET Library CV5000_Series dll is a NET assembly e CV5000_ActivationTool This shortcut will launch an application that will activate the product e Activation Log This shortcut will open a directory that will contain diagnostic information for any activation issues 4 3 Activating the CV 5000 Net Library 1 Select the CV5000_ActivationTool shortcut from the CV 5000 program menu and the following window should appea
70. gDelegate ByVal entry As String Called with an invoke when udating txtStatus in event handler Private Sub UpdateStatus ByVal entry As String txtStatus Text entry vbCrLf txtStatus Text End Sub Update status TextBox use invoke if necessary Private Sub SetStatus ByVal entry As String If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateStringDelegate AddressOf UpdateStatus entry Else Thread safe call update control directly UpdateStatus entry End If End Sub 108 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 Private Sub Forml_FormClosing ByVal sender As System Object ByVal e As System Windows Forms FormClosingEventArgs Handles MyBase FormClosing _cv5000 CloseConnection End Sub Add data received to measurement list box Private Sub UpdateMeasurementData ByVal entry As String lstMeasurementData Items Add entry End Sub Update Measurement list box use invoke if necessary Private Sub SetMeasurementData ByVal entry As String If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateStringDelegate AddressOf UpdateMeasurementData entry Else UpdateMeasurementData entry End If End Sub Private Sub DataReceived ByVal args As DataEventArgs Dim Str As String If args ASCIIDat
71. geConnectionEstablished SetStatus Image port connected End Sub Private Sub ErrorOccurred ByVal args As ErrorOccurredEventArgs If Not args ExceptionCaught Is Nothing Then MessageBox Show args ErrorMessage _ args ExceptionCaught ToString Else MessageBox Show args ErrorMessage End If End Sub Delegate defines function used to update GUI in a threadsafe manner Delegate Sub UpdateStringDelegate ByVal entry As String Called with an invoke when udating txtStatus in event handler Private Sub UpdateStatus ByVal entry As String txtStatus Text entry vbCrLf txtStatus Text End Sub Update status TextBox use invoke if necessary Private Sub SetStatus ByVal entry As String If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateStringDelegate AddressOf UpdateStatus entry Else Thread safe call update control directly UpdateStatus entry End If End Sub 106 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 Private Sub Forml_FormClosing ByVal sender As System Object ByVal e As System Windows Forms FormClosingEventArgs Handles MyBase FormClosing _cv5000 CloseConnection End Sub End Class 107 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement
72. geShutterSpeed Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ChangeShutterSpeed int cameraNumber ShutterSpeed shutterSpeed CW SH cameraNumber 1 to 4 shutterSpeed ShutterSpeed enumeration The value can be one of the following One_15th One_30th One_60th One_120th One_240th One_500th One_1000th One_2000th One_5000th One_10000th One_20000th None RUN Sets all of the current command memory values as the initial values for the command memory ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of CW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode CW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ChangeShutterSpeed 1 ShutterSpeed one_ 120th _cv5000 ChangeShutterSpeed 1 ShutterSpeed one_ 120th 86 Use or disclosure of data on this page is subject to the restrictions Con
73. hanges the pattern counter of the multi pattern mode ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of CW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode CW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SetExtensionPatternCounter 0 _cv5000 SetExtensionPatternCounter 0 90 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 6 4 50 Method SetDateTime Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example Date August 19 2010 public void SetDateTime int yy int mo int dd int hh int mm int ss TW yy year 2 digits mm month dd day hh hour mm minute ss second None RUN Writes the specified date and time to the system ErrorOccurred event triggered The CV 5000 Series device will return an error co
74. he DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode ST RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SaveStatisticalData CV _cv5000 SaveStatisticalData CV 6 4 63 Method WritelmageToDisk Method Signatures public void WritelmageToDisk Bitmap bmp string filename public void WritelmageToDisk DataEventArgs args string filename Base CV Command N A Parameters filename Filename and full path of the image to save Bmp Bitmap to save to disk args DavaEventArgs received by the DataReceived event Return Type None CV Modes N A Description Saves bitmap to disk Method Error ErrorOccurred event triggered On Success Bitmap file saved to disk C Example cv5000 WritelmageToDisk args VB NET Example _cv5000 WritelmageToDisk args 103 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 5 Support The CV 5000 Series NET Library is NOT supported by Keyence Corporation in any way All support issues should be directed to Conquest Consulting LLC www conquesisolutions com We recommend that you
75. he password in the CV Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of PS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode PS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ChangePassword oldPW newPw _cv5000 ChangePassword oldPW newPw 100 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 60 Method RemoteControlPseudolnput Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void RemoteControlPseudolnput RemotelnputCodes inputCodes KY inputCodes RemotelnputCodes enumeration the value can be one of the following FN ES TG SC Vi MN EN UP DNLT RT LU LD RU RD FU FD FL FR FLU FLD FRU FRD RS FV FT FM FE FS SL SR None RUN Disables a communications
76. i aaiae kEi aad ai tana Sai YAna TaY 8 4 3 Activating the CV 5000 Net Library 2 ccsccccescccssseeceseeeceneseneecceneeceeeesaaeesseneeseeeesasseeaeecseneessnens 8 R TAL MOOG sia oss ssitsoessies s aastviaete site eek inden idee detec ees ov see E AE E dh bee sees 9 4 5 Deploying Your Application ieie aana a e EE ENEE AANE TOE E 9 4 5 1 Activation of CV 5000 Net Library on Remote Computer ccccccesceesteceeeetseeeesseeeeseeeetsnens 9 4 5 2 Using the Keyence CV 5000 with 64 bit Operating SYStOIMS ccsccceeececeteesnseeeeeeeeesteeeeaes 10 5 Your First CV 5000 Prograim u ssccsesccssecnssencssnenccseensscenssnencsasanessceensnanssananeaseensuseessnansaaaaeeaseonsesansaeanens 11 5 1 Setting UP your Program emrei ataandaa a a aa oad ra aaa aa dae raTa adaa 12 5 2 Adding a Reference to the CV 5000 NET Library cccccccccsecceceeceseeeeseceeeeeecenseesnsesesneesenseesaes 13 5 3 Add Required GUI Components to the Application s Main Form 1 cccccccscccetssessseceeseecseseetsaes 14 5 4 Connecting to the CV 5000 Device cccescccceseeceeeecsneeeeneecceneeceeneesaaeseenseceeneeesaaesseneecsentetennsseaes 15 5 4 1 Add CV5000_Series Namespace amp Create an CV 5000 Library Object cccccsceceeteeeees 15 5 4 2 GOnnecting to th CV weiter eainiie aa a aa a aA Aaa ah iaai ainaani aao tls ade 16 5 4 3 Creating Event Handlers nisreen deana a Aaaa a aa ari danaa aaa aia PAAD Raai RRi 17 5 4 4 Updating the Status Textbo
77. ionPatternCounter_Error ReadImageBufferWriteToSDCard_Error ImageDataWorker_Error AnalyzeHeaderBytes_Error WriteRegisteredimage_Error ReadRegisteredimage_Error WriteLibraryData_Error ReadLibraryData_Error WriteGlobalSettings_ Error ReadGlobalSettings_Error WriteWindowLimit_Error ReadWindowLimit_Error WriteToCommandMemory_Error SetinitialValuesForCommandMemory_Error ReadFromCommandMemory_Error SetDateTime_Error 31 Date August 19 2010 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date August 19 2010 ReadDateTime_Error Reset_Error RecalculateReferenceValue_Error SaveProgramSettings Error TriggerlnputEnable_Error TriggerInputDisable_Error EnableCommunicationPort_Error DisableCommunicationPort_Error ChangePassword_Error RemoteControlPseudolnput_Error EchoText_Error SaveStatisticalData_Error CommandWorker_Error ImageWorker_Error 6 2 2 Event ConnectionEstablished This event is fired when the application successfully connects with the data port of the CV 5000 series device If communication is attempted before a socket connection is established with the CV 5000 series device then an ErrorOccurred event will be fired The host application should monitor this event to insure that communication with the CV 5000 series device has been established This event has no event arguments 6 2 3
78. lowing methods to the form class Public Class Forml Add data received to measurement list box Private Sub UpdateMeasurementData byval entry As String lstMeasurementData Items Add entry End Sub Update Measurement list box use invoke if necessary Private Sub SetMeasurementData ByVal entry As String If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateStringDelegate AddressOf UpdateMeasurementData entry Else UpdateMeasurementData entry Eno If End Sub End Class The SetMeasurementData method checks a flag InvokeRequired that is supplied by the Net Framework which lets the user know if the event was raised in the user interface thread or not If the event was raised in the user interface thread InvokeRequired False then we can call the UpdateMeasurementData method directly otherwise we have to use the delegate method to call the UpdateMeasurementData method NOTE The UpdateStringDelegate method is the same method that was created in section 5 4 4 so it is not recreated here You will notice that the UpdateMeasurementData method has a compatible signature which is why we can use the same delegate NOTE See the following article in Microsofts documentation for more information on this concept http msdn microsoft com en us library system windows forms control invokerequired aspx 20 Use or disclosure of data on this page is subjec
79. ly UpdateStatus entry 110 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 End If End Sub Private Sub Forml_FormClosing ByVal sender As System Object ByVal e As System Windows Forms FormClosingEventArgs Handles MyBase FormClosing _cv5000 CloseConnection End Sub Add data received to measurement list box Private Sub UpdateMeasurementData ByVal entry As String lstMeasurementData Items Add entry End Sub Update Measurement list box use invoke if necessary Private Sub SetMeasurementData ByVal entry As String If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateStringDelegate AddressOf UpdateMeasurementData entry Else UpdateMeasurementData entry End If End Sub Private Sub DataReceived ByVal args As DataEventArgs Dim Str As String If args ASCIIData Length gt 30 Then Str args ASCIIData Substring 0 30 Else Str args ASCIIData End If Set the measurement data in the listbox If args RecMode CVRecMode CVError Then SetMeasurementData Str ElseIf args Port CVPort CVDataPort Then SetMeasurementData Str End If Set the image data in the picturebox If args RecMode CVRecMode TrigImageData Or args RecMode CVRecMode RegImageBMP Or args RecMode CVRecMode ScreenCapture Then SetBitmap args Bitmap End If
80. n Connecticut 06001 for the NET software product that accompanies this EULA including any associated media printed materials electronic documentation and or derivative works including materials created with a so called level editor if included collectively referred to as the Software Product As determined by CONQUEST and to the extent provided by any accompanying maintenance agreement the Software Product includes any software updates add on components web services and or supplements that CONQUEST may provide or make available to CUSTOMER after the date CUSTOMER obtains their initial copy of the Software Product to the extent that such items are not accompanied by a separate license agreement or terms of use By obtaining installing downloading accessing or otherwise using the Software Product CUSTOMER agrees to be bound by the terms of this EULA If CUSTOMER does not agree to the terms of this EULA do not install access or use the Software Product and promptly return the unused Software Product to the place of purchase or contact CONQUEST Customer Service for a full refund of the purchase price within 30 days of the original purchase Be advised that the Software Product is the copyrighted work of CONQUEST All rights reserved except as expressly stated herein The Software Product is solely for use by an end user according to the terms of this EULA Any use reproduction or redistribution of the Software Product not in accordance
81. n be one of the following Default_1 Default_2 Calculation_Results Custom_Display None RUN Switches the result display ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of DS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SwitchResultDisplay ResultSwitchingDisplayNumber None _cv5000 SwitchResultDisplay __ ResultSwitchingDisplayNumber None 51 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 11 Method SwitchPageNumber Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SwitchPageNumber int pageNumber DS PG pageNumber 0 to 9999 None RUN Switches to the specified page ErrorOccurred event triggered The C
82. n any one or more instances upon the performance of any of the terms of this EULA or to exercise any right hereunder shall not be construed as a waiver of the future performance of any such term or the future exercise of such right In the event that any provision of this EULA shall be held by a court or other tribunal of competent jurisdiction to be unenforceable in whole or in part such provision will be enforced to the maximum extent permissible and the remaining portions of this EULA shall be construed in all respects as if such invalid or unenforceable provisions were omitted and shall remain in full force and effect The Software Product may not be re exported downloaded or otherwise exported into or to a national or resident of any country to which the U S has embargoed goods or to anyone on the U S Treasury Department s list of Specially Designated Nationals or the U S Commerce Department s Table of Denial Orders By agreeing to the terms of this EULA CUSTOMER is agreeing to the foregoing and CUSTOMER is representing and warranting that CUSTOMER is not located in under the control of or a national or resident of any such country or on any such list CUSTOMER AGREES THAT CUSTOMER HAS READ AND AGREES TO BE BOUND BY ALL TERMS AND CONDITIONS OF THIS EULA Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 2
83. nce of DataEventArgs received over the CVDataPort CommandCode SR RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ReadLibraryDataFromSDDevice 0 0 SDOptions SDCard1 _cv5000 ReadLibraryDataFromSDDevice 0 0 _ SDOptions SDCard1 74 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 34 Method ReadLibraryDataFromCurrentProgram TBD Update DataEventArgs Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadLibraryDataFromCurrentProgram int programNumber SR BD CP programNumber 0 to 999 None RUN Reads library data from the Current Program ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of SR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SR RecMode Property Cm
84. nce of DataEventArgs received over the CVDataPort CommandCode SW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteLibrary DataToSDDevice 0 0 SDOptions SDCard1 data _cv5000 WriteLibraryDataToSDDevice 0 0 _ SDOptions SDCard1 data 68 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 28 Method WriteLibraryDataToCurrentProgram Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteLibraryDataToCurrentProgram int libraryNumber byte data SW DC CP libraryNumber 0 to 999 data Byte array containing registered image data None RUN Writes library data to the current program ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of SW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort
85. nd the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SwitchPageNext _cv5000 SwitchPageNext 53 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 13 Method SwitchPagePrevious Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SwitchPagePrevious DS PG None None RUN Displays the previous page ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of DS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Er
86. nder As System Object ByVal e As System EventArgs Handles MyBase Load End Sub End Class For this sample program we are going to create a CV 5000 object that is global to Form1 Add the following code just below the forms class definition as shown below Imports CV5000_Series Public Class Forml Private _cv5000 As cv5000 15 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 5 4 2 Connecting to the CV Date August 19 2010 The sample program will connect to the CV 5000 as soon as it starts up so we will need to create an instance of the CV 5000 library and configure it to connect to the CV 5000 when the form loads This is accomplished by adding the following code to the form s load event as shown below Private Sub Forml_Load ByVal sender As System Object ByVal e As System EventArgs Handles MyBase Load Create _cv5000 Set up _cv5000 _cv5000 an instance of the CV 5000 library New CV5000 the CV 5000 I P address and port information RemotePort 8500 RemoteImagePort 8501 _cv5000 RemoteHost 192 168 168 211 Connect to the CV 5000 series device _cv5000 Connect End Sub NOTE For the RemoieHost property use the IP address that was configured in the CV 5000 series device being connected to NOTE The CQActivation dll must be copied over to the application directory for the prog
87. ning the Application with Connection Events In its present state all the application does is connect to the CV 5000 series device Run the application since the connect command is in the Form1_Load event handler once you run the program you should see something similar to the image on the left below It may take a second or two for the command port connected text to appear If the application is not able to connect to the CV 5000 series device the error message s shown in the image on the right will appear after several seconds If you ran into an error while creating the code in this section Appendix A 1 contains a listing of the code up to this point 19 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 5 5 5 5 1 Date August 19 2010 Retrieving Measurement Data from the CV 5000 Device In this section we will be expanding the code that we created in section 5 4 to retrieve measurement data from the CV 5000 and display it in the measurement list box We will introduce a new event DataReceived and set up the Start and Stop buttons Updating the Measurement ListBox in a ThreadSafe way The sample application has a measurement listbox that is updated each time measurement data is received The code below shows how to use the CV 5000 NET Library in a thread safe way to update the measurement listbox in the application Add the fol
88. nsionUnitLightIntensity int lightNumber int lightIntensityValue CW LV lightNumber 1 to 8 lightIntensityValue 0 to 255 None RUN Changes the intensity level of the specified light on the extension unit ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of CW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode CW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ChangeExtensionUnitLightIntensity 1 125 _cv5000 ChangeExtensionUnitLightIntensity 1 125 89 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 49 Method SetExtensionPatternCounter Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SetExtensionPatternCounter int counterValue CW PC counterValue 0 to 3 None RUN C
89. nt Date August 19 2010 DataType Property Binary Port Property CVimagePort CVPort enumeration C Example cv5000 Trigger 1 VB NET Example _cv5000 Trigger 1 41 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 2 Method ChangeModeToRun Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ChangeModeToRUN RO None None PROGRAM Changes mode from PROGRAM to RUN ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of RO The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode RO RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ChangeModeToRUN _cv5000 ChangeModeToRUN 42 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting
90. nt triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of BL The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode BL ResultData List of Registred images seperated by commas Example 000 001 004 RecMode Property ListReglmages CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 RetrieveListRegisteredlmagesCurrentProgram 1 _cv5000 RetrieveListRegisteredlmagesCurrentProgram 1 59 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 19 Method RetrieveListRegisteredimages Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void RetrieveListRegisteredimages int cameraNumber int programNumber SDOpiions sdOption BL cameraNumber 1 to 4 programNumber 0 to 999 sdOption SDOptions enumeration SDCard1 or SDCard2
91. ntPLOGraM ccssccccsceceeecessnsecseneecsnetecsesteneeetennetenaees 67 6 4 27 Method WriteLibraryDataTOSDD VICE 1 c cccccececseeceensecseneececaeeteaaecseneeceneteseaesseneetenenetsnens 68 6 4 28 Method WriteLibraryDataToCurrentProgram cccccceccessseecseeeceneeteeecseneecsnntessasseseneetsnntetiaees 69 6 4 29 Method ReadProgramDataFroMSDDeVviCe csccccceccccsseceececenseeensecseneecseneessassssseeseeeeessnees 70 6 4 30 Method ReadProgramDataFromCurrentProgram csccccsccccsceceeseesnecseseeceneeesseesseneessnntetsases 71 6 4 31 Method ReadRegisteredimMageFroMSDDeviCe ssccccccccsesceeceeeeeensecseseecseetessassesneeseneeessiness 72 6 4 32 Method ReadRegisterediMageFromCurrentProgral 1 ccccccceeccecesscsseneecseetessiesesseeceneeestnaees 73 6 4 33 Method ReadLibraryDataFromSDDevice TBD Update DataEVentArgS cccccceceee 74 6 4 34 Method ReadLibraryDataFromCurrentProgram TBD Update DataEventArgs 2 75 6 4 35 Method RetrieveListOfLibraryNUMDELS c ccccceccecessceeneeceeececeneesensecseneeceeeeessassseeeeesenneetnaees 76 6 4 36 Method WriteGlobalSettingSData 2 cccccecccescecceneeceeeeeenseceeneeeseeetenaecseaeecseeeessaesseneeetenneesaees 77 6 4 37 Method ReadGlobalSettingSData scccccccccscccceneecseesesneceseneecenneseaecseseecseetessssseseneessnnsesaees 78 6 4 38 Method WriteBinaryFilterData cccccccccceceeceeseecceneecsneeeeaeecseececeuseseaaesse
92. ntProgramNumber PR None None RUN Requests the current program number from the CV 5000 series device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of PR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode PR SDCard SDCard1 or SDCard2 RecMode Property ProgramNumber CVReceiveMode enumeration ResultData Property Three digit string representing the program number Result Property Integer representing the program number ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 ReadCurrentProgramNumber _cv5000 ReadCurrentProgramNumber AT Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 7 Method SwitchWindowNumber Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SwitchWindowNumber int windowNumber UW p
93. ntain a value of Error The ErrorOccurred event will NOT be triggered in this case Under normal operation the DataType property will not contain a value of Unknown RecMode Property Type CVRecMode This property is used to interpret the data received from the CV 5000 series device Whenever data is received from the CV 5000 series device this device must be checked so the host application will know what properties to look at in the DateEventArgs object For example if the value of CVRecMode is TriglmageData then the application will know that the Bitmap property contains a valid bitmap The CVRecMode enumeration will contain one of the following values Unknown Norm ScreenCapture ImageData ProgData EnvSettings 33 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 ReglmageBMP ReglmageJPEG TrigResultData TriglmageData TrigNoData CVError ListReglmages ListLibraryNumbers CmdResponseNoData CmdScreenCapture ProgramNumber WindowNumber SavedReglmageData FilterData GlobalSettings WindowLimit CommandMemory DateTime Echo Port Property Type CVPort This property indicates whether the data received came over the data port or the image port CVPort is a public enumeration in the CV 5000 series library and the two possible values are CVDataPort and CVImagePort BinaryData Pr
94. nying downloaded or printed materials All intellectual property rights including but not limited to patentable inventions copyrights trade secrets and trademarks are owned by CONQUEST Nothing in this EULA gives CUSTOMER any ownership interests in the Software Product CUSTOMER may make one copy of the Software Product for back up and archival purposes CUSTOMER may make one copy the printed materials accompanying the Software Product Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 CUSTOMER may not remove modify or alter any CONQUEST copyright or trademark notices from any part of the Software Product including but not limited to any such notices contained in the physical and or electronic media or documentation in the CONQUEST Setup Wizard dialogue or about boxes in any of the runtime resources and or in any web presence or web enabled notices code or other embodiments originally contained in or otherwise created by the Software Product The Software Product may contain certain materials licensed to CONQUEST and these licensors may individually and separately protect their rights in the event of any violation of this Agreement By agreeing to the terms of this EULA CUSTOMER agrees to the terms of the license of such materials licensed to CONQUEST 3 CONFIDENTIALITY CUSTOMER acknowledges that the Software Pr
95. ode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 ReadProgramDataFromCurrentProgram _cv5000 ReadProgramDataFromCurrentProgram 71s Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 31 Method ReadRegisteredlmageFromSDDevice Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadRegisteredlmageFromSDDevice int programNumber int cameraNumber int registeredImageNumber SDOptions option SR BD programNumber 0 to 999 cameraNumber 1 to 4 registeredlmageNumber 0 to 999 option SDOption enumeration SDCard1 or SDCard2 None RUN Reads registered image from SD Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of SR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SR BinaryData Property Byte array containing registered image RecMode
96. oduct includes confidential and proprietary information of CONQUEST CUSTOMER will take all reasonable precautions necessary to safeguard the confidentiality of the Software Product CUSTOMER will not modify decompile disassemble or reverse engineer the Software Product or assist any other party in doing the same Additionally CUSTOMER and its employs will not use the Software Product to create a new product modify an existing product or to assist any other party in doing same to compete either directly or indirectly with any products and or services of CONQUEST CUSTOMER acknowledges that any unauthorized use or disclosure of the Software Product will cause irreparable harm to CONQUEST If an unauthorized use or disclosure occurs CUSTOMER will promptly inform CONQUEST and take all steps that are necessary to recover the Software Product and to prevent its subsequent unauthorized use or dissemination CONQUEST shall be entitled to equitable relief including reasonable attorney s fees and expenses to enforce this requirement 4 UPGRADES AND SUBSCRIPTION If the Software Product is labeled or otherwise identified by CONQUEST as an upgrade or subscription CUSTOMER must be properly licensed to use a product identified by CONQUEST as being eligible for the upgrade in order to use the Software Product A Software Product labeled or otherwise identified by CONQUEST as an upgrade replaces and or supplements the product that formed the basis
97. of this document A 2 Date August 19 2010 MEASUREMENT DATA CODE LISTING Imports CV5000_Series Public Class Forml Private _CV5000 As CV5000 Private Sub Forml_Load ByVal sender As System Object ByVal e As System EventArgs Handles MyBase Load Create an instance of the CV 5000 library _ CV5000 New CV5000 Set up the CV 5000 I P address and port information _cv5000 RemotePort 8500 _cv5000 RemoteImagePort 8501 _cv5000 RemoteHost 192 168 168 211 Add the event handlers AddHandler _cv5000 ConnectionEstablished AddressOf ConnectionEstablished AddHandler _cv5000 ImageConnectionEstablished AddressOf ImageConnectionEstablished AddHandler _cv5000 ErrorOccurred AddressOf ErrorOccurred AddHandler _cv5000 DataReceived AddressOf DataReceived Connect to the CV 5000 series device _cv5000 Connect End Sub Triggered when the command port is connected to Private Sub ConnectionEstablished SetStatus Command port connected End Sub Triggered when the image port is connected to Private Sub ImageConnectionEstablished SetStatus Image port connected End Sub Private Sub ErrorOccurred ByVal args As ErrorOccurredEventArgs If Not args ExceptionCaught Is Nothing Then MessageBox Show args ErrorMessage _ args ExceptionCaught ToString Else MessageBox Show args ErrorMessage End If End Sub Delegate defines function used to update GUI in a threadsafe manner Delegate Sub UpdateStrin
98. of this document Date August 19 2010 6 4 39 Method ReadBinaryFilterData Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadBinaryFilterData int windowNumber JR windowNumber 0 to 127 None RUN Obtains binary filter data measurement ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of JR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode JR ResultData xxx yyy xxx Upper Limit yyy lowerLimit RecMode Property FilterData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 ReadBinaryFilterData 0 _cv5000 ReaaBinaryFilterData 0 80 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 40 Method WriteWindowCalculationValue Method Signature Base CV Command Parameters
99. ommand Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SetTriggerDelayValue int cameraNumber int triggerDelay CW DT cameraNumber 1 to 4 triggerDelay 0 to 999 None RUN Changes the camera s trigger dealy ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of CW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode CW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SetTriggerDelayValue 1 200 _cv5000 SetTriggerDelayValue 1 200 88 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 48 Method ChangeExtensionUnitLightIntensity Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ChangeExte
100. ommandCode SW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteRegisteredlmageToSDDevice 0 1 0 SDOptions SDCard1 data _cv5000 WriteRegisteredImageToSDDevice 0 1 0 _ SDOptions SDCard1 data 66 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 26 Method WriteRegisteredimageToCurrentProgram Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteRegisteredImageToCurrentProgram int cameraNumber int registeredimageNumber byte data SW BD CP cameraNumber 1 to 4 registeredlmageNumber 0 to 999 data Byte array containing registered image data None RUN Writes registered image to the current program ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCodez2 of SW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs re
101. onnectionEstablished AddressOf ConnectionEstablished AddHandler _cv5000 ImageConnectionEstablished AddressOf ImageConnectionEstablished AddHandler _cv5000 ErrorOccurred AddressOf ErrorOccurred AddHandler _cv5000 DataReceived AddressOf DataReceived Connect to the CV 5000 series device _cv5000 Connect End Sub Triggered when the command port is connected to Private Sub ConnectionEstablished SetStatus Command port connected End Sub Triggered when the image port is connected to Private Sub ImageConnectionEstablished SetStatus Image port connected End Sub Triggered when an error occurs Private Sub ErrorOccurred ByVal args As ErrorOccurredEventArgs If Not args ExceptionCaught Is Nothing Then MessageBox Show args ErrorMessage _ args ExceptionCaught ToString Else MessageBox Show args ErrorMessage End If End Sub Delegate defines function used to update GUI in a threadsafe manner Delegate Sub UpdateStringDelegate ByVal entry As String Called with an invoke when udating txtStatus in event handler Private Sub UpdateStatus ByVal entry As String txtStatus Text entry vbCrLf txtStatus Text End Sub Update status TextBox use invoke if necessary Private Sub SetStatus ByVal entry As String If InvokeRequired Then Not thread safe call update control in a thread safe manner Invoke New UpdateStringDelegate AddressOf UpdateStatus entry Else Thread safe call update control direct
102. operty Type byte Array This property will contain an array of bytes if the DataType property indicates a response of binary data Otherwise this property will be NULL ASCl Data Property Type String This property will return the data received as a string from the first byte received until the first carriage return in the data received ErrorCode Property Type CVErrorCode If the DataType property indicates an Error then this property should be read by the application to determine what the error is The CVErrorCode Enumeration can contain one of the following values No_Error 1 Invalid_Command 0 Command_Action_Disabled 1 Work_Memory_Error 2 Parameter_Error 22 Password_Error 80 Password Command _Error 81 Checksum_Error 90 Timeout_Error 91 ErrorCodeString Property Type string Returns the string representation of the value in the ErrorCode property with the underscores removed 34 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 Bitmap Property Type Bitmap This property will contain a bitmap if a bitmap was received from the CV 5000 series device The CVRecModes that indicate a bitmap are ScreenCapture ReglmageBMP ReglmageJPEG and TriglimageData The property generates a new bitmap Once the application no longer needs the bitmap the Di
103. putEnable TE ON None None RUN Enables both the external trigger and internal trigger ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of TE The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode TE RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 TriggerInputEnable _cv5000 TriggerInputEnable 96 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 56 Method TriggerlnputDisable Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void TriggerInputDisable TE OF None None RUN Disables both the external trigger and internal trigger ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a Command
104. quest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 46 Method ChangeCameraSensitivity Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ChangeCameraSensitivity int cameraNumber int sensitivity CW SE cameraNumber 1 to 4 sensitivity 10 to 90 None RUN Changes the camera s sensitivity ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of CW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode CW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 ChangeCameraSensitivty 1 50 _cv5000 ChangeCameraSensitivty 1 50 87 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 47 Method SetTriggerDelayValue Method Signature Base CV C
105. r EE CV 5000 Library Activation Please email Conquest Consulting To Activate Product Email Conquest Support Provide following code to Conquest representative 50 H70 H63 H38 H31 H77 Hc7 H 81 Copy To Cipboard Unlock Code received from Conquest Consulting Activate Product 2 Click the Copy To Clipboard button to copy the code that appears on the screen 3 Click the Email Conquest Support link on the top right corner of the form and the default email client should open with an email addressed to support conquestsolutions com 4 Right click in the email body and select Paste A code like the following will appear in the email body 4B EF 57 F0 68 FF F1 0F 5 Put your contact information in the email and send the email 6 Conquest will respond to the email with an activation code When the activation code arrives copy the code to the windows clipboard and click on the Copy from Clipboard button to paste the activation code into the form 7 Select either the Development Activation or Distribution Activation radio button You must make the same selection that you made above in step 2 8 Click the Activate Product button If the activation is successful a development license will be written to the computer Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 4 4 4 5 4 5 1 Da
106. r N A On Success If data is sent over the network connection the DataSent event will be triggered but this does not guarantee that the data was received by the CV 5000 series device Look for an occurrence of the DataReceived event in response to the command sent to the CV 5000 series device C Example cv5000 SendRawCommand T 1 VB NET Example _cv5000 SendRawCommand T 1 6 3 4 Method SendRawCommandaArray Method Signature public bool SendRawCommandaArray Byte sendBytes Parameters sendBytes Entire command as an array of bytes Return Type None CV Modes ALL Description This method will send a command to the CV 5000 series device Most applications will not need to use this command Use the SendRawCommand methods Method Error ErrorOccurred event triggered CV Error N A On Success If data is sent over the network connection the DataSent event will be triggered but this does not guarantee that the data was received by the CV 5000 series device Look for an occurrence of the DataReceived event in response to the command sent to the CV 5000 series device C Example cv5000 SendRawCommandArray cmdArray VB NET Example _cv5000 SendRawCommandaArray cmdaArray Note cmdArray is an array of the commands that can be sent to the CV 5000 37 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6
107. ram to run This directory will be named Debug or Release depending on what configuration is set with the configuration manager in Visual Studio See section 4 5 Deployment for more information on this 16 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date August 19 2010 5 4 3 Creating Event Handlers In the last section you created a connection to the CV 5000 but we do not know whether or not the connection was successful This is because the CV 5000 NET Library communicates with the application through events A complete list of the events is contained in Section 6 2 The sample application will use a subset of these events It is through these events that your application will receive the data and any status information that the CV 5000 returns To set up your code to be able to handle these events you first have to create hooks into the CV 5000 NET Library s events and then you have to create the event handlers in your application Since we want to be able to get feedback from the Connect method we must add these hooks before we connect to the CV 5000 Add the following code to the form s load method as shown below Set up the CV 5000 I P address and port information _cv5000 RemotePort 8500 _cv5000 RemoteImagePort 8501 _cv5000 RemoteHost 192 168 16
108. rn an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of LK The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode LK RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 EnableCommunicationsPort CommunicationsPort El pw _cv5000 EnableCommunicationsPort _ CommunicationsPort El pw 98 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 58 Method DisableCommunicationsPort Method Signature Base CV Command Parameters Password Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void DisableCommunicationsPort CommunicationsPort communication string password LK OF communication CommunicationsPort enumeration The value can be one of the following RS RS 232 PL PLC US USB ET Ethernet CC CC Link El Ethernet IP CN Remote Control Console string containing pw set in CV Series
109. rogramNumber Window number in CV 5000 series device 0 to 127 None RUN Switches to the specified windows number and refreshes the screen ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of UW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode UW RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SwitchWindowNumber 0 _cv5000 SwitchWindowNumber 0 48 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 8 Method ReadCurrentWindowNumber Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadCurrentWindowNumber UR None None RUN Requests the current window number from the CV 5000 series device ErrorOccurred event triggered The CV 5000 Series device will return an error code
110. roperties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode TR RecMode Property DateTime CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 ReadDateTime _cv5000 ReadDateTime 92 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 52 Method RecalculateReferenceValues Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void RecalculateReferenceValues RR None None RUN Recalculates the base reference values using the currently registered images ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of RR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode RR RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVEr
111. roperty ProgData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 ReadProgramDataFromSDDevice 0 SDOptions SDCard1 _cv5000 ReadProgramDataFromSDDevice 0 _ SDOptions SDCard1 70 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 30 Method ReadProgramDataFromCurrentProgram Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadProgramDataFromCurrentProgram SR DT CP None None RUN Retrieves program data from the current program ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of SR The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SR BinaryData Property Byte array containing program data RecMode Property ProgData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorC
112. ror Port Property CVDataPort CVPort enumeration cv5000 SwitchPagePrevious _cv5000 SwitchPagePrevious 54 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 6 4 14 Method SwitchScreen Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example Date August 19 2010 public void SwitchScreen int screenNumber DS FC screenNumber 1 to 5 None RUN Switches to the specified screen when multiple screens are displayed ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of DS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SwitchScreen 1 _cv5000 SwitchScreen 1 55 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LL
113. rorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 WriteProgramDataToCurrentProgram programData _cv5000 WriteProgramDataT oCurrentProgram programData 65 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 25 Method WriteRegisteredilmageToSDDevice Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteRegisteredlmageToSDDevice int programNumber int cameraNumber int registeredImageNumber SDOptions option byte data SW BD programNumber 0 to 999 cameraNumber 1 to 4 registeredlmageNumber 0 to 999 option SDOption enumeration SDCard1 or SDCard2 data Byte array containing registered image data None RUN Writes registered image to SD Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of SW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort C
114. rorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 RecalculateReferenceValues _cv5000 RecalculateReferenceValues 93 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 53 Method SaveProgramSettings Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SaveProgramSettings SS None None RUN Saves the program settings ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of SS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SaveProgramSettings _cv5000 SaveProgramSettings 94 Use or disclosure of data on this page is subject to the restrictions Conqu
115. rror CV Error On Success C Example VB NET Example public void RequestScreenCapture BC CM None None RUN Requests a screen shot and retrieves the image on the CVCommand Port ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of BC The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode BC Bitmap Property Windows Bitmap of Image RecMode Property ScreenCapture CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 RequestScreenCapture _cv5000 RequestScreenCapture 57 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 17 Method Registerlmage Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void Registerlmage int cameraNumber int registeredlmageNumber BS cameraNumber 1 to
116. ry Reference s1ccccecccseeccsseenssersssnseecssennsnenssanncaseonsseenssnaaseaseonssensessaneasaees 27 OT PrI 3 sis sh ate He E a Raa i ae ia ee O 27 iii Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 CA PrOperys NAMG 2i se su neta tees E eee ea es elena ka toe oe ha E a eed 27 6 1 2 Properly PASSWOMO tscerdiis es ston ta ies iis eed pase eee teva hiss Bete tite ee Aaaa 27 6 433 Property ROMOlEHOSTES s ast 9523 00 e en RA a ee St aes 28 6 1 4 Property ROMOLOP OM bas scszsissstaneeesssuzzetyatsnebestacseancussapeeausagactqasassaposeiaazecaasaptenssacaacgraaignseesstesei za 28 6 1 5 Property REMOtEIMAGEPOM ccccssccccceensececeeesceceseeaeeseceenseseseeseesessesaeseseeseeseseeesseseeseaeeesenanes 28 6 1 6 Property DebugMode_LogToFile 1 ccccsscccccesssscessencesecsesceesesseacecesseaaeeseseseeseseeseeeeeeeeseeeeeeanes 29 6 1 7 Property ErrOrLOQQinng orarin e a E A AA E TAE E EA 29 6 1 8 Property Binary DUMP aen a a aa a aa Gisele envi T 29 SAE 1111 AEEA E E oitvae chet adieieeed dopa let en enema bess 30 62 1 Event ErrorOccurreg assassinate ology isa wi sialed laine A A aai oea ads 30 6 2 2 Event CONN CtionEStabliShe cccccccessscccceessececesescesesseaeecessensesesseaeesesseeeeesesseneessseeseseessnness 32 6 2 3 Event ImageConnectionEstabliShed 1 ccccccccccccec
117. s Debug Resources Services Settings Reference Paths Signing Security Publish Configuration Active Debug Z Platform Active Any CPU General Conditional compilation symbols 7 Define DEBUG constant Define TRACE constant Platform target C Allow unsafe code E Optimize code 4 Errors and warnings Warning level 4 x Suppress warnings Treat warnings as errors None Specific warnings 10 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date August 19 2010 5 YOUR FIRST CV 5000 PROGRAM This program will demonstrate the use of the CV 5000 NET Library in a simple program to log measurement data and part images sent from the CV 5000 This example assumes you are familiar with VB NET and Visual Studio 2008 NOTE Before you create the sample program you must set the IP address in the CV 5000 and configure the CV 5000 to output all measurement data and acquired images to be sent via the Ethernet Configuring the CV 5000 is beyond the scope of this document and is not discussed here Please consult the assistance of your companies IT department and refer to the CV 5000 User s Manual for more information The sample program will be responsible for triggering the CV 5000 every 5 seconds When measurement and image data is received by the CV 5000 via the Ethernet connection it will be displ
118. scribed in section 4 1 on each computer that will run the application that utilizes the CV 5000 Net Library Then follow the instructions in section 4 3 of this manual for activating the CV 5000 Net library 2 Manually copy and paste ActivationTool exe along with CQActivation dll to each computer that will run the application that utilizes the CV 5000 Net Library Then follow the instructions in section 4 3 of this manual for activating the CV 5000 Net library 3 Create a setup program that will distribute the ActivationTool exe along with the application that utilizes the CV 5000 Net library Make sure the setup program places a copy of CQActivation dll in the same directory as ActivationTool exe Then follow the instructions in section 4 3 of this manual for activating the CV 5000 Net library on each computer where this setup program is run Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 4 5 2 Using the Keyence CV 5000 with 64 bit Operating Systems Date August 19 2010 If a Net application that uses the CV 5000 library is run on a 64 bit version of Windows then the Net application must be configured to always run in 32 bit mode To do this right click on the project in visual studio and click on the build tab on the left The following screen will be shown Change the platform target to x86 Application Build Build Event
119. seeceentessasseseneetenntesiaees 79 6 4 39 Method ReadBinaryFilterData 2 sccccccccceeceeneeceeeeeceneeesaecsceneeceaeessaaesseneecsetessassseneessnstetsness 80 6 4 40 Method WriteWindowCalculationVAlUC 1 s ccccscccceecseeseeceeneecsentecsaeeseseeecsnetessassesseecenstersanens 81 6 4 41 Method ReadWindowCalculation Value ccscccccececeecsessseceeneecenececsaaecseneecseetessassseneeseneeetsaees 82 6 4 42 Method Write TOCOMMANAMEMOLY u cccccccccsseceenceceneceeneecseneeceeeesneecseseecseneesassesneeetsnnsesiaees 83 6 4 43 Method ReadFromCommandMemory ssscccccceceececnescsesecseececenneseeeceececessnesssaseseneetsensesiaees 84 6 4 44 Method SetinitialValuesFOrCOMMANAMEMOL 1 ccccccccseeceeeeeteneeeensecseeeecseetesseeeseneetennsetnaess 85 6 4 45 Method Change ShutterSpeed 2 ccccscccsscccseneceneceseesseneecseneesenssseneecseneesensssaaecseneeseenstsaees 86 6 4 46 Method ChangeCarmeraSen sitivity csccccccccccsceceececesecseneecseeeecennesseneeceeneeseeeseseeseneessensesnaees 87 6 4 47 Method SetTriggerDelayVAlUC 2 cccscccceeceeeseeceeeeecsneeesaecseaceceneteseaaecseneeceeesessassseneesseenetsness 88 6 4 48 Method ChangeExtensionUnitLightIntensity 2 ccccccccessceesceceeesecensecseneecseeseseassseneecseeeettiaees 89 6 4 49 Method SetExtensionPatternCOumter scccsccccecceceerseseneecseececensesensecseaeecsuesessaaeeseneeseensesnaees 90 6 4 50 Method SetDate Time ecccccsccccs
120. ser_Defined_Template_4 User_Defined_Template_5 User_Defined_Template_6 None RUN Switches the display template ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of DS The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode DS RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error Port Property CVDataPort CVPort enumeration cv5000 SwitchDisplayTemplate DisplaySwitchingT emplateNumber SDCard1 _cv5000 SwitchDisplayTemplate _ DisplaySwitchingTemplateNumber SDCard1 50 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 10 Method SwitchResultDisplay Method Signature Base CV Command Parameters None Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SwitchResultDisplay ResultSwitchingDisplayNumber template DS RS template Value in ResultSwitchingDisplayNumber Enumeration The value ca
121. spose function should be called on the bitmap to release its resources back to windows TriggeredlmageCameraNumber Property Type int Returns the camera image when a triggered image is received Only valid when receive mode is TrigimageData This property is only implemented in version 2 0 and later of the CV 5000 library TriggeredimageTotalStatus Property Type TotalStatus Returns the total status when a triggered image is received Only valid when receive mode is TrigimageData This property is only implemented in version 2 0 and later of the CV 5000 library The TotalStatus enumeration can contain one of the following values Not_Applicable 1 OK 0 NG 1 TriggeredimageMeasurementCount Property Type int Returns the measurement count when a triggered image is received Only valid when receive mode is TriglmageData This property is only implemented in version 2 0 and later of the CV 5000 library ResultData Property Type string This property is valid for commands that have a DataType of ASCII The meaning of this property will depend on the command that was sent to the CV 5000 device See the documentation for the command sent to the CV 5000 Result Property Type integer This property will return a numerical value for commands that support it For commands that don t support a single numerical value being returned this property will return 0 6 2 6 Event ConnectionLost This event is fired if the CV 5000
122. sultData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration If image data is received as a result of the trigger the image data will be received on the CVimagePort The DataEventArgs will contain the following values Bitmap Property Bitmap of Image BinaryData Byte array containing bitmap bytes CommandCode MO depending on which trigger was triggered RecMode Property TrigimageData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration 44 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 ErrorCodeString Property No Error DataType Property Binary Port Property CVimagePort CVPort enumeration C Example cv5000 RepeatOutputMeasurementResult VB NET Example _cv5000 RepeatOutputMeasurementResult 45 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 5 Method SwitchProgramNumber Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void SwitchProgramNumber
123. t CommandCode BT RecMode Property CmdResponseNoData CVReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property ASCII Port Property CVDataPort CVPort enumeration cv5000 ReadAlllmageDatalnBuffer 1 CompressionRatio One Specifiedlmage OK CV _cv5000 ReadAlllmageDatalnBuffer 1 CompressionRatio One Specifiedlmage OK CV 63 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 23 Method WriteProgramDataToSDDevice Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void WriteProgramDataToSDDevice int programNumber SDOptions option byte programData SW DT programNumber 0 to 999 sdOption SDOption enumeration SDCard1 or SDCard2 programData Array of bytes None RUN Writes program data to SD Device ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode 2 of SW The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the
124. t enumeration cv5000 WriteGlobalSettingsData data _cv5000 WriteGlobalSettingsData data f Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 6 4 37 Method ReadGlobalSettingsData Method Signature Base CV Command Parameters Return Type CV Modes Description Method Error CV Error On Success C Example VB NET Example public void ReadGlobalSettingsData SA None None RUN Retrieves global settings ErrorOccurred event triggered The CV 5000 Series device will return an error code and the DataReceived event will be triggered with a CommandCode of ER and a CommandCode2 of SA The error that the device returned will be in the ErrorCode property of the DataEventArgs object DataReceived event will be fired and the following properties will be set in the instance of DataEventArgs received over the CVDataPort CommandCode SA BinaryData Property Byte array containing global settings RecMode Property GlobalSettings C VReceiveMode enumeration ErrorCode Property No_Error CVErrorCode enumeration ErrorCodeString Property No Error DataType Property Binary Port Property CVDataPort CVPort enumeration cv5000 ReadGlobalSettingsData _cv5000 ReadGlobalSettingsData 78 Use or disclosure of data on this page is subject to the restrictions
125. t to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 5 5 2 Add Data Received Event Handler Date August 19 2010 When the CV 5000 NET Library receives data from the CV 5000 it raises the Data Received event To retrieve the data you must hook into the event and add a handler for it First hook into the event in the form s load method with the rest of the handlers as shown below Link our handlers to the events being created by the CV 5000 AddHandler _cv5000 ConnectionEstablished AddressOf ConnectionEstablished AddH w AddHandler _cv5000 ErrorOccurred AddressOf ErrorOccurred AddHandler _cv5000 DataReceived AddressOf DataReceived Connect to the CV 5000 series device _cv5000 Connect ndler _cv5000 ImageConnectionEstablished AddressOf ImageConnectionEstablished Now that the hooks are in place we can add the event handler to our application Add the following method to the form class Public Class Forml Private Sub DataReceived ByVal args As DataEventArgs Dim Str As String The data from the CV 5000 is stored in args If args ASCIIData Length gt 30 Then Str args ASCIIData Substring 0 30 Else Str args ASCIIData End If If args RecMode CVRecMode CVError Then SetMeasurementData Str ElseIf args Port CVPort CVDataPort Then SetMeasurementData Str End LE End Sub End Class 2
126. te August 19 2010 Trial Mode Until the CV 5000 Net library is activated it will run in trial mode for 30 days Programs run under trial mode will experience a dialog box every thirty 30 minutes prompting the user to enter the trial password obtained from Conquest Consulting Deploying Your Application You must include the following files when deploying your application CV5000 Series dll This file contains all the properties methods and events for the CV 5000 Net library This file must reside in the same directory as the final application CQActivation dll This file handles the licensing for the CV 5000 Net library This file must reside in the same directory as the final application CV5000 Series pdb This file contains debugging information that can be used with the CV5000_Series dll This file is optional and if distributed it must reside in the same directory as the final application These files can be located in the CV 5000 NET Library installation directory Locate this directory by clicking on the CV5000 shortcut fm cv 5000 cysooo GE Activation Log al c 5000_ActivationTool Activation of CV 5000 Net Library on Remote Computer The ActivationTool exe application must be used on each computer that runs the CV 5000 Net Library to activate the distribution license for that computer There are three ways to install this activation tool on each computer 1 Run the CV 5000 Net Library Installation as de
127. tion with the Trigger Data Run the application and press the start button The output should look similar to the following screen shot on the right The actual data shown will depend on the configuration of the program in the CV 5000 series device The data will be received once every 5 seconds so you may want to wait for about 20 seconds or so to elapse ES Form1 T1 0082269 1 09 06 05 19 33 01 71 0078789 1 09 06 05 19 33 06 71 0074613 1 09 06 05 19 33 11 T1 0073044 1 09 06 05 19 33 16 T1 0073158 1 09 06 05 19 33 21 T1 0075835 1 09 06 05 19 33 26 7100761 20 1 09 06 05 19 33 31 71 0076936 1 09 06 05 19 33 36 7100831 65 1 09 06 05 19 33 41 Image port connected Start Command port connected If you ran into an error while creating the code in this section Appendix A 2 contains a listing of the code up to this point 23 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 5 6 Retrieving Image Data from the CV 5000 Device In this section we will be expanding the code that we created in section 5 5 to retrieve image data from the CV 5000 and display it in the picture box 5 6 1 Updating the PictureBox in a Thread safe Manner The sample application has a picture box that is updated each time image data is received The code below shows how to use the CV 5000 NET Library in a thread safe way to update th
128. vice ReadProgramDataFromCurrentProgram ReadRegisteredlmageFromSDDevice ReadRegisteredImageFromCurrentProgram ReadLibraryDataFromSDDevice ReadLibraryDataFromCurrentProgram Writing the Global settings data SB WriteGlobalSettingsData Reading the Global settings data SA ReadGlobalSettingsData Retrieving a list of library numbers DL RetrieveListOfLibraryNumbers 38 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 Writing the binary data JW WriteBinaryFilterData Reading the binary data JR ReadBinaryFilterData Writing the limit settings DW WriteWindowCalculationValue Reading the limit settings DR ReadWindowCalculationValue Writing the command memory MW WriteToCommandMemory Reading the command memory MR ReadFromCommandMemory Setting initial values for command MI SetlnitialValuesForCommandMemory mem Writing the camera Light CW ChangeShutterSpeed extension unit settings ChangeCameraSensitivity SetTriggerDelayValue ChangeExtensionUnitLightIntensity SetExtensionPatternCounter Writing the date and time settings TW SetDateTime Reading date and time settings TR ReadDateTime Recalculating a base value RR RecalculateReferenceValues Saving the setup values Ss SaveProgramSettings Resetting RS Reset
129. visit our Support area on our Web site first This area has been proven to answer the majority of common support questions 104 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 APPENDIX A CODE LISTINGS 105 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date August 19 2010 A 1 CONNECTION CODE LISTING Imports CV5000_Series Public Class Formi Private _CV5000 As CV5000 Private Sub Forml_Load ByVal sender As System Object ByVal e As System EventArgs Handles MyBase Load Create an instance of the CV 5000 library _ CV5000 New CV5000 Set up the CV 5000 I P address and port information _cv5000 RemotePort 8500 _cv5000 RemoteImagePort 8501 _cv5000 RemoteHost 192 168 168 211 Add the event handlers AddHandler _cv5000 ConnectionEstablished AddressOf ConnectionEstablished AddHandler _cv5000 ImageConnectionEstablished AddressOf ImageConnectionEstablished AddHandler _cv5000 ErrorOccurred AddressOf ErrorOccurred Connect to the CV 5000 series device _cv5000 Connect End Sub Triggered when the command port is connected to Private Sub ConnectionEstablished SetStatus Command port connected End Sub Triggered when the image port is connected to Private Sub Ima
130. x in a Thread safe MAnner cccccsssccecessseceseessecesssnseeeeeeesseeesees 18 5 4 5 Closing CONNECHONS sss pesi ales ee aisha pitas a ae eae aR 19 5 4 6 Running the Application with Connection EVONUS ccccccccceerceseseseenseceneeeceestseseeceeneetsnneteaes 19 5 5 Retrieving Measurement Data from the CV 5000 Device ccccesssccecsessecessenteeesseseeeesenseeseees 20 5 5 1 Updating the Measurement ListBox in a ThreadSal way u scccccscccesseceeneeeeneeessseeseeecsnneetsaes 20 5 5 2 Add Data Received Event Handle r ccccccccccsceceseecssestensecseeeecseaeeseneecsencecsaeessaeeseneeetenssteaes 21 5 5 3 Setting up the TIMET aieis2 te Ge ie i ie eles ie ab ee a eee 22 5 5 4 Setting up the Start and Stop Buttons 2 cccccccceseeeeseeceeneeceneeesaesseseecseneeseaesesaesseeeneteneeteaes 22 5 5 5 Running the Application with the Trigger Data scccccssccesscecesesecsseeseneececeeeceneetsnseeseneestenneteaes 23 5 6 Retrieving Image Data from the CV 5000 Device 1 ccsccceccceceecessseeeeeeceeeeecseesseneeceeneetsnneteaes 24 5 6 1 Updating the PictureBox in a Thread Safe Manner ccccccccccecesseeseneecseeeecenesesnseeeeneecsnneeteaes 24 5 6 2 Add Image Data to the Data Received Handler ccsccccscccceceeecsseceeneecseeeeceeneesnseteeseeesnneesiaes 25 5 6 3 Running the Complete Sample ProQrain c s ccccsccecssceenecseeeeceneseeseeceeneecsesesaeeseneessenseteaes 26 6 The CV 5000 NET Libra

Download Pdf Manuals

image

Related Search

Related Contents

Detecto-Pak III - Heath Consultants  Unified Electronic System of State Procurement User Manual  Manuale di Istruzioni - (05055)  Appendix VI Samples of Final Year Projects with Marking Sheets  Einrichtung von Web Gateway  For Android devices, install our Android app from Google Play by  User Manual for Passive House School Buildings    o texto técnico na sua diversidade em ambiente de empresa  Samsung Samsung SGH-L170 Käyttöopas  

Copyright © All rights reserved.
Failed to retrieve file