Tutorial setting CAMFile untuk kamera JAI LQ-200CL pada software CamEd Bitflow Carbon-CL FrameGrabber
Thursday, February 1, 2018
Wednesday, January 3, 2018
Using Vectornav VN-200 in Visual Studio .NET
1. First determine the connection parameters for connecting to the VN-100 sensor. You will need to know the following information.
- COM Port
- COM Baud Rate (factory default of sensor is 115200)
2. Open Microsoft Visual Studio and create a new project by going to the menu File → New → Project.... Select the Visual C# project template of Console Application and name the project VisualStudioUsage.
3.Browse to the location C:/Program Files/VectorNav .NET Library (or C:/Program Files (x86)/VectorNav .NET Library if you are on a 64-bit machine) and copy the files VectorNav.dll and VectorNav.xml into the directory where you saved your new Visual Studio project. Then add a reference to the assembly by right-clicking on the project icon in Visual Studio and from the context menu, select Add Reference.... The window Add Reference should now be displayed. Select the Browse tab and then browse and select the VectorNav.dll that you copied into your project folder.
4. Under the project VisualStudioUsage, open the file Program.cs. You will now need to add a using VectorNav.Devices; statement to make the library's classes easily accessible. Your code should now look like the snippet below.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using VectorNav.Devices; | |
namespace UsingLocalAssembly | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
} | |
} | |
} |
5. Now we will add code statements to connect to the sensor, read data values from the sensor and display them on the screen for 10 seconds, and then disconnect from the sensor. The code to perform these steps are listed below and should be what the file Program.cs looks like.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using VectorNav.Devices; | |
namespace UsingLocalAssembly | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Create instance of the Vn100 class. | |
// NOTE: You must change the values listed below for your specific | |
// COM Port and COM Baud Rate. | |
var vn100 = new Vn100("COM1", 115200); | |
// Connect to the physical VN-100 sensor. | |
vn100.Connect(); | |
// Loop for 10 iterations while displaying data. | |
for (var i = 0; i < 10; i++) | |
{ | |
// Pause the program for 1 second. | |
System.Threading.Thread.Sleep(1000); | |
// Get the most up-to-date data received from the sensor. | |
var curMeas = vn100.CurrentMeasurements; | |
// Write out the YawPitchRoll measurements to the console. | |
Console.WriteLine(string.Format( | |
"YPR: {0}, {1}, {2}", | |
curMeas.YawPitchRoll.YawInDegs, | |
curMeas.YawPitchRoll.PitchInDegs, | |
curMeas.YawPitchRoll.RollInDegs)); | |
} | |
// Disconnect from the sensor and exit. | |
vn100.Disconnect(); | |
} | |
} | |
} |
6. Now to run the code, click the Play icon on the Visual Studio toolbar, or go to the menu Debug → Start Debugging. You should now see a console window pop-up and start displaying YawPitchRoll data from the sensor.
Tuesday, November 21, 2017
Visual Studio 2012 fatal error LNK1104: cannot open file 'clallserial.lib'
You must include your library directory in your sources; For that add path to
your project folder: Project -> Properties -> Configuration Properies
-> General -> VC++ Directories -> Include Directories and
Library Directories;
Visual Studio 2012 error MSB8020: The builds tools for v120 (Platform Toolset = 'v120') cannot be found
right-click on project name -> properties -> configuration
properties -> general -> platform toolset -> Visual Studio 2012
(v110)
Other option is download and setup Microsoft Build Tools 2013 from http://www.microsoft.com/en-US/download/details.aspx?id=40760
Other option is download and setup Microsoft Build Tools 2013 from http://www.microsoft.com/en-US/download/details.aspx?id=40760
Thursday, November 9, 2017
Camera Link Camera Configuration over Frame Grabber Camera Link Serial Port
Camera Configuration within Camera Link is based on a simple asynchronous serial reading and writing of configuration data. Within the Camera Link standard specification, a serial communication interface is defined. This standardized serial interface is available on the frame grabber. It enables the interaction of a vendor specific camera configuration tool and the frame grabber specific implementation of the serial communication functionality.
In simple words: Any Camera Link compliant camera configuration software runs in combination with any Camera Link frame grabber. In this project we use Bitflow Karbon-CL Frame Grabber.
CLComm - An interface to the Camera Link serial port library.
This wraps both the standard CLAllSerial.h interface, and the BFSerial.h library, which provides various useful extensions to the core library.
To access Camera Link Serial Port cameras require a DLL file, which is supplied by the frame grabber manufacturer, to be installed on the PC. To verify this, use the PC’s registry editor (regedit) to confirm the following setting:
HKEY_LOCAL_MACHINE->SOFTWARE-> “CLSERIALPATH”.
Then, check the folder specified in the “Data” field of “CLSERIALPATH”, and verify that the folder contains a “clser***.dll” file.
Note: the file name of the DLL file is clser***.dll. “***” is up to the frame grabber manufacturer. If the DLL file does not exist there, place the DLL file into the folder. The DLL file is supplied by the frame grabber manufacturer.
Add a "CLAllSerial.NET.dll" reference to the target project, right click the project, choose "Add References" then from the "Projects" tab, choose "CLAllSerial.NET.dll" from your working directory.
To list available port using ComboBox DropDown list:
To list available baudrate ComboBox DropDown list:
Initialize the port:
Serial Receive Thread Function:
Close the Port for reading thread:
In order to use CLComm Component in the project, first add a reference to it, make sure to place the file "CLAllSerial.NET.dll" into your working directory, and set the target framework to ".NET Framework 4.5". The component "CLAllSerial.NET.dll" has compiled using ".NET Framework 4.5" so the target project must also use ".NET Framework 4.5".
Add a "CLAllSerial.NET.dll" reference to the target project, right click the project, choose "Add References" then from the "Projects" tab, choose "CLAllSerial.NET.dll" from your working directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CLComm; | |
// private member | |
private CLAllSerial m_clserial; | |
// Initialize the first Bitflow, Inc. CLSerial Interface. | |
m_clserial = new CLAllSerial(); | |
if (0 == CLAllSerial.GetNumPorts()) | |
{ | |
MessageBox.Show("The system has no CLSerial ports! Aborting.", "SimpleCom Initialization Error"); | |
Close(); | |
Application.Exit(); | |
} |
If you got this error message while debugging : " Could not load file or assembly 'ManagedBid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92d16d74ab2a6c4b' or one of its dependencies. An attempt was made to load a program with an incorrect format. " , check your "target framework" setting on your property, change to ".NET Framework 4.5".
To list available port using ComboBox DropDown list:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
serialPortDropDown.Items.Clear(); | |
uint numPorts = CLAllSerial.GetNumPorts(); | |
for (uint i = 0; i < numPorts; i++) | |
{ | |
string manufacturer = "", portID = ""; | |
uint version = 0; | |
CLAllSerial.GetPortInfo(i, ref manufacturer, ref portID, ref version); | |
string ItemObject = "(" + i + ") " + manufacturer + ", " + portID; | |
serialPortDropDown.Items.Add(ItemObject); | |
} |
To list available baudrate ComboBox DropDown list:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baudRateDropDown.Items.Clear(); | |
// Add all supported baud rates to the combo box list. | |
CLAllSerial.BaudRates rates = m_clserial.GetSupportedBaudRates(); | |
string currentRate; | |
// Determine the current baud rate (just set it, if we aren't a BF port). | |
if (m_clserial.PortIsBF) | |
currentRate = m_clserial.BFGetBaudRate().ToString(); | |
else | |
{ | |
m_clserial.SetBaudRate(CLAllSerial.BaudRates.CL_BAUDRATE_9600); | |
currentRate = CLAllSerial.BaudRates.CL_BAUDRATE_9600.ToString(); | |
} | |
foreach (string rate in rates.ToString().Split(',')) | |
{ | |
string ItemObject = rate.Trim("CL_BAUDRTE ".ToArray()); | |
baudRateDropDown.Items.Add(ItemObject); | |
} | |
baudRateDropDown.Text = currentRate.Trim("CL_BAUDRTE ".ToArray()); |
Initialize the port:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
// Stop the data receive thread. | |
readThreadStop(); | |
// Close the opened serial port. | |
m_clserial.SerialClose(); | |
// Attempt to open the designated port. | |
m_clserial.SerialInit(index); | |
string manufacturer = "", portID = ""; | |
uint version = 0; | |
CLAllSerial.GetPortInfo(index, ref manufacturer, ref portID, ref version); | |
// Set the GUI as necessary. | |
serialPortDropDown.Text = manufacturer + ", " + portID; | |
populateBaudRateDropDown(); | |
// Restart the data receive thread. | |
m_readThread = new Thread(new ThreadStart(serialReadThreadFunc)); | |
m_readThreadContinue = true; | |
m_readThread.Start(); | |
} | |
catch (ApplicationException err) | |
{ | |
MessageBox.Show("Serial port initialization failed: " + err.Message, "CLSerial Initialization Error"); | |
Close(); | |
Application.Exit(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// The serial read thread function. | |
/// </summary> | |
private void serialReadThreadFunc() | |
{ | |
try | |
{ | |
if (m_clserial.PortIsBF) | |
{ | |
// This is a BF port, so prefer the BFSerialRead method. | |
try | |
{ | |
while (m_readThreadContinue) | |
comListAppend(m_clserial.BFSerialRead(1024)); | |
} | |
catch (OperationCanceledException) | |
{ } | |
} | |
else | |
{ | |
// For non-BF ports, use the conventional SerialRead method. | |
while (m_readThreadContinue) | |
{ | |
uint readLen = m_clserial.GetNumBytesAvail(); | |
if (0 < readLen) | |
comListAppend(m_clserial.SerialRead(readLen, 100)); | |
Thread.Sleep(0); | |
} | |
} | |
} | |
catch (ApplicationException err) | |
{ | |
MessageBox.Show("Caught an exception: " + err.Message + "\n\nAborting the read thread. Data can still be written, but no data will be received.", "Data Read Thread Error"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Stop execution of the serial read thread. This method blocks until the read thread is halted. | |
/// </summary> | |
private void readThreadStop() | |
{ | |
if (null == m_readThread) | |
return; | |
do | |
{ | |
m_readThreadContinue = false; | |
if (m_clserial.PortIsBF) | |
m_clserial.BFSerialCancelRead(); | |
} | |
while (!m_readThread.Join(10)); | |
} |
Thursday, November 2, 2017
Cara membuat hotspot Wifi Windows 8 auto run di Start Up Program
Pertama buat file batch ( batch script, bat file atau DOS command file), simpan file di start up menu program. Lokasi foldernya biasanya di: "AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" .
Di Windows 8 kita tidak bisa menjalankan file *.bat sebagai administrator, kita harus mengklik kanan kemudian pilih menu "run as administrator". Cara lainnya yaitu dengan membuat shortcut file link dari file *.bat tersebut kemudian pilih property, advance property, dan centang kotak checkbox "Run as administrator"
Dalam hal ini kendala utamanya adalah semua metode diatas membutuhkan operator untuk melakukannya. Yang mana kita harus selalu melakukan metode diatas berulang ulang setiap kali booting ulang atau restart windows.
Untuk solusi dari masalah tersebut adalah dengan menambahkan beberapa baris kode program di dalam file *.bat sehingga file *.bat tersebut dapat bekerja sebagai administrator secara otomatis tanpa memerlukan instruksi tambahan dari operator ataupun file tambahan. Berikut kode perintah program yang perlu ditambahkan dibaris pertama dari file *.bat nya.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: BatchGotAdmin (Run as Admin code starts) | |
REM --> Check for permissions | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
REM --> If error flag set, we do not have admin. | |
if '%errorlevel%' NEQ '0' ( | |
echo Requesting administrative privileges... | |
goto UACPrompt | |
) else ( goto gotAdmin ) | |
:UACPrompt | |
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" | |
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" | |
"%temp%\getadmin.vbs" | |
exit /B | |
:gotAdmin | |
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) | |
pushd "%CD%" | |
CD /D "%~dp0" | |
:: BatchGotAdmin (Run as Admin code ends) | |
:: Your codes should start from the following line |
File *.bat yang diawal baris telah ditulis kode perintah program seperti diatas maka akan menjalankan program sebagai administrator. Selanjutnya tambahkan kode perintah program berikut untuk mendaftarkan hotspot wifi SSID dan passwordnya.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netsh wlan set hostednetwork mode=allow ssid=wifihotspotku key=1234asdf |
- SSID = adalah nama hotspot yang diinginkan, silahkan dirubah sesuai keinginan
- KEY = password atau security key dari hotspot yg dibuat
Apabila kode perintah sukses, maka respon dari OS adalah sebagai berikut.
Selanjutnya untuk mengaktifkan hotspot wifi yang telah didaftarkan diatas, tambahkan kode perintah program berikut.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netsh wlan start hostednetwork |
Apabila kode perintah sukses, maka respon dari OS adalah sebagai berikut.
Kode perintah lengkapnya adalah sebagai berkut, selanjutnya simpan file dengan nama bebas, gunakan extension bat, dan taruh di dalam folder "AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" agar pada saat windows start program batch ini akan langsung dieksekusi.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: BatchGotAdmin (Run as Admin code starts) | |
REM --> Check for permissions | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
REM --> If error flag set, we do not have admin. | |
if '%errorlevel%' NEQ '0' ( | |
echo Requesting administrative privileges... | |
goto UACPrompt | |
) else ( goto gotAdmin ) | |
:UACPrompt | |
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" | |
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" | |
"%temp%\getadmin.vbs" | |
exit /B | |
:gotAdmin | |
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) | |
pushd "%CD%" | |
CD /D "%~dp0" | |
:: BatchGotAdmin (Run as Admin code ends) | |
:: Your codes should start from the following line | |
netsh wlan set hostednetwork mode=allow ssid=wifihotspotku key=1234asdf | |
netsh wlan start hostednetwork |
Selanjutnya klik "Change Adapter Setting" di pojok kiri atas, untuk melihat Semua koneksi network yang tersedia di komputer, termasuk koneksi hotspot yang telah dibuat sebelumnya.
Seperti dilihat pada screenshoot gambar diatas, hotspot yang baru dibuat dikenali sebagai "Local Area Connection* 4", dengan nama SSID adalah "AirborneCamHotSpot". Sekarang tinggal dipilih dari koneksi internet mana yang mau di share ke jaringan "Local Area Connection* 4". Bisa share internet dari Modem USB , Ethernet LAN ataupun dari WiFi luar.
Klik kanan pada koneksi network yang terhubung Internet (saat ini yang dicoba adalah dari Ethernet LAN yang terhubung dengan jaringan Internet Indihome SPEEDY), kemudian pilih property, klik tab "Sharing", dan kemudian centang checklist "Allow other network users to connect through this computer's Internet connection".
Kemudian pilih "Home networking Connection:" sesuai LAN hotspot yang telah dibuat tadi, yaitu: "Local Area Connection* 4". Selanjutnya centang juga cheklist "Allow other network users to control or disable the shared Internet connection) dan klik OK.
Dan selesai sudah semua, hotspot WiFi anda sudah siap diakses dari perangkat lain. Untuk mengeceknya silahkan cari dan coba sambungkan hotspot yang telah dibuat tadi dari WiFi Smartphone anda atau dari Laptop disekitar anda.
Monday, June 5, 2017
Alat pengisi sosis / mesin pencetak sosis manual bahan stainless steel
Alat pengisi sosis / mesin pencetak sosis manual bahan stainless steel
Mesin Pencetak Sosis
mesin ini digunakan untuk mencetak adonan sosis secara manual tanpa menggunakan listrik, anda akan mendapatkan 4 ukuran diameter sosis yaitu : 15mm, 18mm, 22mm dan 28 mm.
sangat cocok digunakan untuk para pemula bisnis sosis maupun hanya digunakan untuk rumahan saja.
fitur mesin cetak sosis :
- body stainless steel sehingga aman untuk produk makanan
- terdapat 4 type ukuran cetak sosis
- manual hydrolic
Spesifikasi:
- Corong berbahan plastik
- Material barrel length: 49cm
- Tank diameter: 12.5cm
- About weight: 4.5 kg
- Capacity: 4liter / 4 kg
- Body (drums) Material: Stainless Steel 304
- Base and mounting bracket Material: Stainless Steel 304
Hubungi:
Email/YM : nugroho_w_jatmiko@yahoo.com
Whatsapp : Order Alat pengisi sosis / mesin pencetak sosis manual bahan stainless steel
Tokopedia: Alat pengisi sosis / mesin pencetak sosis manual bahan stainless steel
Subscribe to:
Posts (Atom)