CF-RU 5102 UHF USB Desktop Reader vb.net SDK “Serial Communication” error
up vote
0
down vote
favorite
I'm working with CF-RU 5102 desktop reader to read a RFID card. I have downloaded vb.net SDK from http://www.chafon.com/productdetails.aspx?pid=384.
when i run the sdk im getting error "serial communication error".
SDK : CF-RU5102 UHFReader09 vb6.0_17051009420181.rar
OS : Windows 10
Source Code:
private void OpenPort_Click(object sender, EventArgs e)
{
int port=0;
int openresult,i;
openresult = 30;
string temp;
Cursor = Cursors.WaitCursor;
if (Edit_CmdComAddr.Text=="")
Edit_CmdComAddr.Text="FF";
fComAdr = Convert.ToByte(Edit_CmdComAddr.Text,16); // $FF;
try
{
if (ComboBox_COM.SelectedIndex == 0)//Auto
{
fBaud = Convert.ToByte(ComboBox_baud2.SelectedIndex);
if (fBaud>2)
{
fBaud = Convert.ToByte(fBaud + 2);
}
openresult =StaticClassReaderB.AutoOpenComPort(ref port,ref fComAdr,fBaud,ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0 )
{
ComOpen = true;
// Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
Button3_Click(sender, e); //自动执行读取写卡器信息
if ((fCmdRet==0x35) |(fCmdRet==0x30))
{
MessageBox.Show ("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
ComOpen = false;
}
}
}
else
{
temp = ComboBox_COM.SelectedItem.ToString();
temp = temp.Trim();
port = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
for (i = 6; i >= 0; i--)
{
fBaud = Convert.ToByte(i);
if (fBaud == 3)
continue;
openresult = StaticClassReaderB.OpenComPort(port, ref fComAdr, fBaud, ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0x35)
{
MessageBox.Show("COM Opened", "Information");
return;
}
if (openresult == 0)
{
ComOpen = true;
Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
if ((fCmdRet == 0x35) || (fCmdRet == 0x30))
{
ComOpen = false;
MessageBox.Show("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
return;
}
RefreshStatus();
break;
}
}
}
}
finally
{
Cursor = Cursors.Default;
}
if ((fOpenComIndex != -1) &(openresult != 0X35) &(openresult != 0X30))
{
ComboBox_AlreadyOpenCOM.Items.Add("COM"+Convert.ToString(fOpenComIndex)) ;
ComboBox_AlreadyOpenCOM.SelectedIndex = ComboBox_AlreadyOpenCOM.SelectedIndex + 1;
Button3.Enabled = true ;
Button5.Enabled = true;
Button1.Enabled = true;
button2.Enabled = true;
Button_WriteEPC_G2.Enabled = true;
Button_SetMultiReadProtect_G2.Enabled = true;
Button_RemoveReadProtect_G2.Enabled = true;
Button_CheckReadProtected_G2.Enabled = true;
button4.Enabled = true;
SpeedButton_Query_6B.Enabled = true ;
ComOpen = true;
}
if ((fOpenComIndex == -1) &&(openresult == 0x30))
MessageBox.Show("Serial Communication Error", "Information");
if ((ComboBox_AlreadyOpenCOM.Items.Count != 0)&(fOpenComIndex != -1) & (openresult != 0X35) & (openresult != 0X30)&(fCmdRet==0))
{
fComAdr = Convert.ToByte(Edit_ComAdr.Text,16);
temp = ComboBox_AlreadyOpenCOM.SelectedItem.ToString();
frmcomportindex = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
}
RefreshStatus();
}
Please help me on this issue.
Thanks.
vb.net sdk rfid
add a comment |
up vote
0
down vote
favorite
I'm working with CF-RU 5102 desktop reader to read a RFID card. I have downloaded vb.net SDK from http://www.chafon.com/productdetails.aspx?pid=384.
when i run the sdk im getting error "serial communication error".
SDK : CF-RU5102 UHFReader09 vb6.0_17051009420181.rar
OS : Windows 10
Source Code:
private void OpenPort_Click(object sender, EventArgs e)
{
int port=0;
int openresult,i;
openresult = 30;
string temp;
Cursor = Cursors.WaitCursor;
if (Edit_CmdComAddr.Text=="")
Edit_CmdComAddr.Text="FF";
fComAdr = Convert.ToByte(Edit_CmdComAddr.Text,16); // $FF;
try
{
if (ComboBox_COM.SelectedIndex == 0)//Auto
{
fBaud = Convert.ToByte(ComboBox_baud2.SelectedIndex);
if (fBaud>2)
{
fBaud = Convert.ToByte(fBaud + 2);
}
openresult =StaticClassReaderB.AutoOpenComPort(ref port,ref fComAdr,fBaud,ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0 )
{
ComOpen = true;
// Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
Button3_Click(sender, e); //自动执行读取写卡器信息
if ((fCmdRet==0x35) |(fCmdRet==0x30))
{
MessageBox.Show ("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
ComOpen = false;
}
}
}
else
{
temp = ComboBox_COM.SelectedItem.ToString();
temp = temp.Trim();
port = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
for (i = 6; i >= 0; i--)
{
fBaud = Convert.ToByte(i);
if (fBaud == 3)
continue;
openresult = StaticClassReaderB.OpenComPort(port, ref fComAdr, fBaud, ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0x35)
{
MessageBox.Show("COM Opened", "Information");
return;
}
if (openresult == 0)
{
ComOpen = true;
Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
if ((fCmdRet == 0x35) || (fCmdRet == 0x30))
{
ComOpen = false;
MessageBox.Show("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
return;
}
RefreshStatus();
break;
}
}
}
}
finally
{
Cursor = Cursors.Default;
}
if ((fOpenComIndex != -1) &(openresult != 0X35) &(openresult != 0X30))
{
ComboBox_AlreadyOpenCOM.Items.Add("COM"+Convert.ToString(fOpenComIndex)) ;
ComboBox_AlreadyOpenCOM.SelectedIndex = ComboBox_AlreadyOpenCOM.SelectedIndex + 1;
Button3.Enabled = true ;
Button5.Enabled = true;
Button1.Enabled = true;
button2.Enabled = true;
Button_WriteEPC_G2.Enabled = true;
Button_SetMultiReadProtect_G2.Enabled = true;
Button_RemoveReadProtect_G2.Enabled = true;
Button_CheckReadProtected_G2.Enabled = true;
button4.Enabled = true;
SpeedButton_Query_6B.Enabled = true ;
ComOpen = true;
}
if ((fOpenComIndex == -1) &&(openresult == 0x30))
MessageBox.Show("Serial Communication Error", "Information");
if ((ComboBox_AlreadyOpenCOM.Items.Count != 0)&(fOpenComIndex != -1) & (openresult != 0X35) & (openresult != 0X30)&(fCmdRet==0))
{
fComAdr = Convert.ToByte(Edit_ComAdr.Text,16);
temp = ComboBox_AlreadyOpenCOM.SelectedItem.ToString();
frmcomportindex = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
}
RefreshStatus();
}
Please help me on this issue.
Thanks.
vb.net sdk rfid
Please try to add a code sample (take look at How to create a Minimal, Complete, and Verifiable example). The question probably will be closed as off-topic when it remains like it is now.
– IvanH
Nov 19 at 9:33
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm working with CF-RU 5102 desktop reader to read a RFID card. I have downloaded vb.net SDK from http://www.chafon.com/productdetails.aspx?pid=384.
when i run the sdk im getting error "serial communication error".
SDK : CF-RU5102 UHFReader09 vb6.0_17051009420181.rar
OS : Windows 10
Source Code:
private void OpenPort_Click(object sender, EventArgs e)
{
int port=0;
int openresult,i;
openresult = 30;
string temp;
Cursor = Cursors.WaitCursor;
if (Edit_CmdComAddr.Text=="")
Edit_CmdComAddr.Text="FF";
fComAdr = Convert.ToByte(Edit_CmdComAddr.Text,16); // $FF;
try
{
if (ComboBox_COM.SelectedIndex == 0)//Auto
{
fBaud = Convert.ToByte(ComboBox_baud2.SelectedIndex);
if (fBaud>2)
{
fBaud = Convert.ToByte(fBaud + 2);
}
openresult =StaticClassReaderB.AutoOpenComPort(ref port,ref fComAdr,fBaud,ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0 )
{
ComOpen = true;
// Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
Button3_Click(sender, e); //自动执行读取写卡器信息
if ((fCmdRet==0x35) |(fCmdRet==0x30))
{
MessageBox.Show ("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
ComOpen = false;
}
}
}
else
{
temp = ComboBox_COM.SelectedItem.ToString();
temp = temp.Trim();
port = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
for (i = 6; i >= 0; i--)
{
fBaud = Convert.ToByte(i);
if (fBaud == 3)
continue;
openresult = StaticClassReaderB.OpenComPort(port, ref fComAdr, fBaud, ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0x35)
{
MessageBox.Show("COM Opened", "Information");
return;
}
if (openresult == 0)
{
ComOpen = true;
Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
if ((fCmdRet == 0x35) || (fCmdRet == 0x30))
{
ComOpen = false;
MessageBox.Show("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
return;
}
RefreshStatus();
break;
}
}
}
}
finally
{
Cursor = Cursors.Default;
}
if ((fOpenComIndex != -1) &(openresult != 0X35) &(openresult != 0X30))
{
ComboBox_AlreadyOpenCOM.Items.Add("COM"+Convert.ToString(fOpenComIndex)) ;
ComboBox_AlreadyOpenCOM.SelectedIndex = ComboBox_AlreadyOpenCOM.SelectedIndex + 1;
Button3.Enabled = true ;
Button5.Enabled = true;
Button1.Enabled = true;
button2.Enabled = true;
Button_WriteEPC_G2.Enabled = true;
Button_SetMultiReadProtect_G2.Enabled = true;
Button_RemoveReadProtect_G2.Enabled = true;
Button_CheckReadProtected_G2.Enabled = true;
button4.Enabled = true;
SpeedButton_Query_6B.Enabled = true ;
ComOpen = true;
}
if ((fOpenComIndex == -1) &&(openresult == 0x30))
MessageBox.Show("Serial Communication Error", "Information");
if ((ComboBox_AlreadyOpenCOM.Items.Count != 0)&(fOpenComIndex != -1) & (openresult != 0X35) & (openresult != 0X30)&(fCmdRet==0))
{
fComAdr = Convert.ToByte(Edit_ComAdr.Text,16);
temp = ComboBox_AlreadyOpenCOM.SelectedItem.ToString();
frmcomportindex = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
}
RefreshStatus();
}
Please help me on this issue.
Thanks.
vb.net sdk rfid
I'm working with CF-RU 5102 desktop reader to read a RFID card. I have downloaded vb.net SDK from http://www.chafon.com/productdetails.aspx?pid=384.
when i run the sdk im getting error "serial communication error".
SDK : CF-RU5102 UHFReader09 vb6.0_17051009420181.rar
OS : Windows 10
Source Code:
private void OpenPort_Click(object sender, EventArgs e)
{
int port=0;
int openresult,i;
openresult = 30;
string temp;
Cursor = Cursors.WaitCursor;
if (Edit_CmdComAddr.Text=="")
Edit_CmdComAddr.Text="FF";
fComAdr = Convert.ToByte(Edit_CmdComAddr.Text,16); // $FF;
try
{
if (ComboBox_COM.SelectedIndex == 0)//Auto
{
fBaud = Convert.ToByte(ComboBox_baud2.SelectedIndex);
if (fBaud>2)
{
fBaud = Convert.ToByte(fBaud + 2);
}
openresult =StaticClassReaderB.AutoOpenComPort(ref port,ref fComAdr,fBaud,ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0 )
{
ComOpen = true;
// Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
Button3_Click(sender, e); //自动执行读取写卡器信息
if ((fCmdRet==0x35) |(fCmdRet==0x30))
{
MessageBox.Show ("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
ComOpen = false;
}
}
}
else
{
temp = ComboBox_COM.SelectedItem.ToString();
temp = temp.Trim();
port = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
for (i = 6; i >= 0; i--)
{
fBaud = Convert.ToByte(i);
if (fBaud == 3)
continue;
openresult = StaticClassReaderB.OpenComPort(port, ref fComAdr, fBaud, ref frmcomportindex);
fOpenComIndex = frmcomportindex;
if (openresult == 0x35)
{
MessageBox.Show("COM Opened", "Information");
return;
}
if (openresult == 0)
{
ComOpen = true;
Button3_Click(sender, e); //自动执行读取写卡器信息
if (fBaud > 3)
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud - 2);
}
else
{
ComboBox_baud.SelectedIndex = Convert.ToInt32(fBaud);
}
if ((fCmdRet == 0x35) || (fCmdRet == 0x30))
{
ComOpen = false;
MessageBox.Show("Serial Communication Error or Occupied", "Information");
StaticClassReaderB.CloseSpecComPort(frmcomportindex);
return;
}
RefreshStatus();
break;
}
}
}
}
finally
{
Cursor = Cursors.Default;
}
if ((fOpenComIndex != -1) &(openresult != 0X35) &(openresult != 0X30))
{
ComboBox_AlreadyOpenCOM.Items.Add("COM"+Convert.ToString(fOpenComIndex)) ;
ComboBox_AlreadyOpenCOM.SelectedIndex = ComboBox_AlreadyOpenCOM.SelectedIndex + 1;
Button3.Enabled = true ;
Button5.Enabled = true;
Button1.Enabled = true;
button2.Enabled = true;
Button_WriteEPC_G2.Enabled = true;
Button_SetMultiReadProtect_G2.Enabled = true;
Button_RemoveReadProtect_G2.Enabled = true;
Button_CheckReadProtected_G2.Enabled = true;
button4.Enabled = true;
SpeedButton_Query_6B.Enabled = true ;
ComOpen = true;
}
if ((fOpenComIndex == -1) &&(openresult == 0x30))
MessageBox.Show("Serial Communication Error", "Information");
if ((ComboBox_AlreadyOpenCOM.Items.Count != 0)&(fOpenComIndex != -1) & (openresult != 0X35) & (openresult != 0X30)&(fCmdRet==0))
{
fComAdr = Convert.ToByte(Edit_ComAdr.Text,16);
temp = ComboBox_AlreadyOpenCOM.SelectedItem.ToString();
frmcomportindex = Convert.ToInt32(temp.Substring(3, temp.Length - 3));
}
RefreshStatus();
}
Please help me on this issue.
Thanks.
vb.net sdk rfid
vb.net sdk rfid
edited Nov 20 at 13:08
asked Nov 19 at 8:18
Anand Kumar P
11
11
Please try to add a code sample (take look at How to create a Minimal, Complete, and Verifiable example). The question probably will be closed as off-topic when it remains like it is now.
– IvanH
Nov 19 at 9:33
add a comment |
Please try to add a code sample (take look at How to create a Minimal, Complete, and Verifiable example). The question probably will be closed as off-topic when it remains like it is now.
– IvanH
Nov 19 at 9:33
Please try to add a code sample (take look at How to create a Minimal, Complete, and Verifiable example). The question probably will be closed as off-topic when it remains like it is now.
– IvanH
Nov 19 at 9:33
Please try to add a code sample (take look at How to create a Minimal, Complete, and Verifiable example). The question probably will be closed as off-topic when it remains like it is now.
– IvanH
Nov 19 at 9:33
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370694%2fcf-ru-5102-uhf-usb-desktop-reader-vb-net-sdk-serial-communication-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please try to add a code sample (take look at How to create a Minimal, Complete, and Verifiable example). The question probably will be closed as off-topic when it remains like it is now.
– IvanH
Nov 19 at 9:33