I'm working in VB.NET and having some issues with a POS Printer I just connected (Epson TM-T88V). I recently downloaded a sample code from something I found on YouTube that used an Epson TM-88II, an older model of the V. This code would work perfectly fine if I could just open the serial port! What's happening is that the printer is on port USB-001 (the virtual printer port) and you can't just set that as your COM Port in VB to write to it. I downloaded the Microsoft POS for .NET and the OPOSN from Epson. The only question I have so far is where do I even start? Can anyone help me with connecting to the printer with VB and then maybe move into sending a basic "Hello World" to the printer followed by an autocut?
Vb.net – POS Printing with an Epson Printer in VB.NET
epsonprintingvb.net
Related Solutions
Are you using an RS-232 transceiver? The Arduino outputs 0 and 5 V for serial, while the printer uses -12 and 12 V for serial. You should use a MAX232 or similar device to get the correct physical interface. (You might be able to cheat if you invert the serial port on the Arduino, but that might not work, and it's more trouble when just getting started.)
Once that's taken care of, the RTS and DTR may be your problem. You should be able to change the DIP-switch settings on the printer and turn off flow control altogether, or switch it to software flow control.
Also, you may need to send both line feed and carriage return.
However, once all that's done it should print just fine, even without any reset commands. Send a bunch of ASCII characters and line feed/carriage returns, and it'll spit it all out.
You can ignore the RX line (on the Arduino side, TX on the printer side) for now - just send it data until you figure out the wiring, level conversion, flow control, etc.
- Start with a clean directory:
/home/user/Desktop/projects/cpp/ # your project lives here
- Add your cmake file(CMakeLists.txt), your source files, and test file. The directory now looks like this:
└─cpp/
├─ CMakeLists.txt
├─ myfunctions.h
└─ mytests.cpp
- Clone and add
googletest
to this directory:
└─cpp/
├─ googletest/
├─ CMakeLists.txt
├─ myfunctions.h
└─ mytests.cpp
- Open your
CMakeLists.txt
and enter the following:
cmake_minimum_required(VERSION 3.12) # version can be different
project(my_cpp_project) #name of your project
add_subdirectory(googletest) # add googletest subdirectory
include_directories(googletest/include) # this is so we can #include <gtest/gtest.h>
add_executable(mytests mytests.cpp) # add this executable
target_link_libraries(mytests PRIVATE gtest) # link google test to this executable
- Contents of
myfunctions.h
for the example:
#ifndef _ADD_H
#define _ADD_H
int add(int a, int b)
{
return a + b;
}
#endif
- Contents of
mytests.cpp
for the example:
#include <gtest/gtest.h>
#include "myfunctions.h"
TEST(myfunctions, add)
{
GTEST_ASSERT_EQ(add(10, 22), 32);
}
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Now you just have to run the tests. There are multiple ways to do that.
In the terminal, create a build/
dir in cpp/
:
mkdir build
Your directory should now look like this:
└─cpp/
├─ build/
├─ googletest/
├─ CMakeLists.txt
├─ myfunctions.h
└─ mytests.cpp
Next go into the build
directory:
cd build
Then run:
cmake ..
make
./mytests
Alternative way:
- Install the
CMake Tools
extension for VS Code - In the bottom bar, you can see the current target (in square brackets Build [mytest] and Run [mytest])you want to build / run:
- Then just click the run button.
Building Google test itself
Using terminal:
- Go into the dir
/home/user/Desktop/projects/cpp/googletest
- Create
build/
inside it so that it looks like following:
└─cpp/googletest/
├─ build/
├─ ...other googletest files
cd build
- Run:
cmake -Dgtest_build_samples=ON -DCMAKE_BUILD_TYPE=Debug ..
make -j4
./googletest/sample1_unittest
Using VS-Code
- Open the
googletest
folder into VS Code - CMake extension will prompt for configuration, allow it
- You will see a
.vscode
directory. Inside it issettings.json
file, open it, and add the following to it:
"cmake.configureSettings": { "gtest_build_samples": "ON" }
- Build and run from the buttons in the bottom bar
Best Answer
This is hard since it is not easy to find good articles. If you look for information you will notice how epson is not really happy sharing their knowleage. bot here are some articles that helped me with this:
** Update **
this is what makes the magic:
And this is how I call whit class: