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.










share|improve this question
























  • 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















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.










share|improve this question
























  • 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













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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin