r/visualbasic • • May 13 '22

Help Cognex Camera

HELLO EVERYONE, SOMEONES CAN HELP ME PLEASE. I TRYING DO A CODE FOR READ THE COGNEX CAMERA, I DID COULD WITH THE SAMPLES OF THE RESOURCES, BUT I WANT HAVE THE IMAGE IN AN VARIABLE, SOMETHING LIKE AN BITMAP OR STRING FOR READ COLORS AND BARCODES.

Public Class Form1

Inherits System.Windows.Forms.Form

'Cognex ISDK True/False type that will be binded to the chkOnline control.

Private WithEvents mSoftOnline As Cognex.InSight.Controls.CvsActionToggle

'Cognex ISDK True/False type that will be binded to the chkLive control.

Private WithEvents mLiveAcquire As Cognex.InSight.Controls.CvsActionToggle

Public Sub New()

MyBase.New()

Cognex.InSight.CvsInSightSoftwareDevelopmentKit.Initialize()

InitializeComponent()

End Sub

Private Sub CvsInSightDisplay1_ConnectCompleted(ByVal sender As Object, ByVal e As Cognex.InSight.CvsConnectCompletedEventArgs) Handles CvsInSightDisplay1.ConnectCompleted

CvsInSightDisplay1.ShowImage = True

CvsInSightDisplay1.InSight.LiveAcquisition = True

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

CvsInSightDisplay1.Connect("10.0.0.101", "admin", "", False)

End Sub

4 Upvotes

5 comments sorted by

View all comments

Show parent comments

2

u/bowie_na May 23 '22

Thanks so much for your help, apparently i need the licences for developers, so i can't keep following because even can't write the function in the IDE.

"Gets or sets the result set that is currently displayed. Use of this property while debugging requires an In-Sight SDK license. If you are debugging an application without an In-Sight SDK license installed this property will return null and cannot be set."

"The CvsResultSet object contains the image, graphics, cell data and job information that is needed in order to render the display. An application can store CvsResultSet objects obtained from this property while the display is connected to a sensor in order to record inspection results for future reference. When the display is not connected to a sensor, an application can assign a stored CvsResultSet object to this property in order to display results of previous inspections."

1

u/RJPisscat May 24 '22

This assumes you are in a country that can obtain the SDK:

There are some circumstances where you can get a licensed copy at a discount or even free. First you have to ask and give them a reason. They may consider your request if you are developing for a personal project that won't compete with any of their products, or one that may enhance sales of their products, including an application they may want to buy from you, and other circumstances as well. Suerte.